1

I used subprocess.popen (for open webdriver) in GUI(pysimplegui) python script, it is working fine on pycharm and when I make its exe file is making its clone while clicking on a specific buttonenter image description here

elif event == 'web':
    subprocess.Popen([sys.executable, "sele.py"])

please help me on this how to handle this thing or how to create subprocess correctly the reason why I am not making a function for it is because if I will do this my button will stuck until the whole function is done thanks

I try different type of subprocess and multithreading but nothing works for me

  • Subprocess makes a fork, so if you don't have your "main" program in a function it will create another copy of your window when the subprocess starts. The PySimpleGUI Exec APIs may be of help and also the threading calls within PySimpleGUI (e.g. window.start_thread is good for long operations). – Mike from PSG Feb 28 '23 at 12:34
  • 1
    Thank you very much man you save my day..... Kindly suggest me a tutorial or documentary where I can learn all major and basic concepts of PySimpleGui. – Muhammad Hussnain Feb 28 '23 at 13:12
  • https://www.PySimpleGUI.org is the main documentation that has a Cookbook along with the main documentation and the call reference. https://eCookbook.PySimpleGUI.org is an interactive cookbook (try it! It's fun). https://Udemy.PySimpleGUI.org is the official PySimpleGUI course on Udemy. The top of the documentation always has a coupon and link to get a discount. Asking questions on the project's github https://Issues.PySimpleGUI.org will get you answers from the developers directly. Be sure to get the Demo Program Launcher. The demo mentions the need for this function. – Mike from PSG Feb 28 '23 at 19:22

0 Answers0