On my local machine, I run a python script which contains this line
bashCommand = \"cwm --rdf test.rdf --ntriples > test.nt\"
os.system(bashCommand)
Don't use os.system
. It has been deprecated in favor of subprocess. From the docs: "This module intends to replace several older modules and functions: os.system
, os.spawn
".
Like in your case:
bashCommand = "cwm --rdf test.rdf --ntriples > test.nt"
import subprocess
process = subprocess.Popen(bashCommand.split(), stdout=subprocess.PIPE)
output, error = process.communicate()