On my local machine, I run a python script which contains this line
bashCommand = \"cwm --rdf test.rdf --ntriples > test.nt\"
os.system(bashCommand)
The pythonic way of doing this is using subprocess.Popen
subprocess.Popen
takes a list where the first element is the command to be run followed by any command line arguments.
As an example:
import subprocess
args = ['echo', 'Hello!']
subprocess.Popen(args) // same as running `echo Hello!` on cmd line
args2 = ['echo', '-v', '"Hello Again"']
subprocess.Popen(args2) // same as running 'echo -v "Hello Again!"` on cmd line