1

in python how to run file and not close file after python code finished?

for example, i try to open a excel file after code finished. But os.startfile("filename.xlsx") will close after finished.

subprocess.Popen() also don't work.

subprocess.call() can keep alive but the python code not finished.

  • Maybe this https://stackoverflow.com/questions/1000900/how-to-keep-a-python-script-output-window-open#:~:text=cmd%20%2Fk%20is%20the%20typical,want%20to%20the%20Run%20dialog. or have you tried running python -i file.py where file.py is your file – smitty_werbenjagermanjensen Apr 29 '21 at 02:28
  • Did you try `os.popen()` method ? – eminaruk Apr 29 '21 at 02:28

0 Answers0