Python: subprocess call with shell=False not working

后端 未结 4 1867
孤街浪徒
孤街浪徒 2020-12-01 16:57

I am using Python script to invoke a Java virtual machine. The following command works:

subprocess.call([\"./rvm\"], shell=False)  # works
subprocess.call([\         


        
4条回答
  •  Happy的楠姐
    2020-12-01 17:11

    Instead of using the filename directory, add the word python in front of it, provided that you've added python path to your environmental variables. If you're not sure, you can always rerun the python installer, once again, provided that you have a new version of python.

    Here's what I mean:

    import subprocess
    subprocess.Popen('python "C:/Path/To/File/Here.py"')
    

提交回复
热议问题