Python Forum
Subprocesses not opening File Select Dialog
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Subprocesses not opening File Select Dialog
#3
I fixed it now. And those " " are important because of file paths like "C:/Users/New Folder/...". Observe the space please. I copied this code from StackOverflow

class UserInfoWidget(BoxLayout):
    def browse_file(self):
        
        co_initialize = ctypes.windll.ole32.CoInitialize
        co_initialize(None)
        import clr
        clr.AddReference('System.Windows.Forms')
        from System.Windows.Forms import OpenFileDialog

        file_dialog = OpenFileDialog()
        print(dir(file_dialog))
        file_dialog.Filter = "Excel files|*.xls;*.xlsx"
        ret = file_dialog.ShowDialog()
        # if ret != 1:
        #     print("Cancelled")
        #     sys.exit()
Reply


Messages In This Thread
RE: Subprocesses not opening File Select Dialog - by teut - Feb-22-2021, 08:07 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Hard disk structure like a file selection dialog malonn 2 816 Aug-09-2023, 09:14 PM
Last Post: malonn
  select files such as text file RolanRoll 2 1,204 Jun-25-2022, 08:07 PM
Last Post: RolanRoll
  [S0LVED] [Tkinter] Center dialog? Winfried 8 4,295 Mar-01-2022, 07:17 PM
Last Post: Winfried
  Facing Problem while opening a file through command prompt vlearner 4 1,970 Jan-30-2022, 08:10 AM
Last Post: snippsat
  how to view all installed software in a dialog Tyrel 6 2,190 Oct-09-2021, 08:11 PM
Last Post: Tyrel
  Set Text in Open Dialog Box giddyhead 0 1,700 May-21-2021, 06:31 PM
Last Post: giddyhead
  Terminating Subprocesses and Threads while they're calculating lvlanson 4 2,578 Oct-17-2020, 12:33 PM
Last Post: lvlanson
  Opening file and outputting its text content example leodavinci1990 1 1,915 Oct-12-2020, 05:33 AM
Last Post: buran
  File Opening Hitso 10 5,333 Jun-05-2020, 10:35 AM
Last Post: DeaD_EyE
  Test a file for a string without opening it? tester_V 2 2,179 Jun-03-2020, 06:40 PM
Last Post: tester_V

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020