我想打開一個文件對話框,而不是我正在工作的目錄。我嘗試這樣做:wx.FileDialog沒有設置目錄
dlg = wx.FileDialog(self, "Open", style=wx.FD_OPEN)
dlg.SetDirectory("C:\Users\tech\Desktop\Circuit Design Tool\Program Files")
dlg.ShowModal()
file_name = dlg.GetPath()
dlg.Destroy()
這:
directory = "C:\Users\tech\Desktop\Circuit Design Tool\Program Files"
dlg = wx.FileDialog(self, "Open", directory, style=wx.FD_OPEN)
dlg.ShowModal()
file_name = dlg.GetPath()
dlg.Destroy()
但他們都開到目錄中,我的工作。有誰知道我做錯了什麼?