I'm looking for a way to launch a compiled processing sketch from a function in python. It would just be a button programed with pygame (having a UI is very important.
can you launch an external file from within python?
I'm looking for a way to launch a compiled processing sketch from a function in python. It would just be a button programed with pygame (having a UI is very important.
can you launch an external file from within python?
In order to launch an extern command using Python3 (or Python2), you can use one of those methods:
Example: i will call the bash function ls -l
:
Method1:
>>> from subprocess import call
>>> call(["ls","-l"]
Method2:
>>> from os import system
>>> system("ls -l")
Bonus:
If you want to retrieve the output of the extern command you called, use this method:
Bonus method:
>>> output = subprocess.Popen("ls -l", shell = True, stdout=subprocess.PIPE)
>>> output