Argument2 supplies an argument to that program telling it that it's going to run a JAR, and finally Argument3 tells the target program where to find the file to open. Subprocess.call([current_path + '/contents/home/bin/java', # Param 1Īrgument 1 targets the program I want to launch. This, for example, launches a JAR file using a specific copy of the Java runtime environment. Passing multiple arguments and paths is equally as simple. If you have only Acrobat Reader DC, choose Adobe Acrobat Reader DC and click OK. Do one of the following: If you have Acrobat DC or both Acrobat DC and Acrobat Reader DC, choose Adobe Acrobat DC and click OK. Opening a file with subprocess.call.Īll you need to do to launch a program is call subprocess.call() and pass in a list of arguments where the first is the path to the program, and the rest are additional arguments that you want to supply to the program you're launching.įor instance, to launch Notepad.exe import subprocess Sign in using an administrator account or contact your administrator to get the button enabled. Not a huge deal, but one less thing to remember). One additional benefit of using subprocessing rather than os.system is that it uses the same syntax cross-platform ( os.system on Windows requires a "start" at the beginning, whereas OS X requires an "open". Expanding on FatalError's suggestion with an example.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |