-
Python script does not work when run through system.callSystem(cmd)
I want to run a python script through system.callSystem in an after effects JSX file. I have done that successfully, but when it comes to opening and writing files in the python script, it does not work. As far as I can tell, there’s nothing wrong with the python code, I have executed it many times in the command prompt and it works perfectly (creates the file and writes data to it).
The javascript code:
var result = system.callSystem("python C:\\Users\\HP\\test.py");
The python code: (writing a simple text file)
file = 'aTextFile.txt'
with open(file,'w') as f:
f.write('hello this is a test again, second one')
print('check your folder')
Any suggestions or other workarounds that I might not be aware of are welcome, thank you!