I found a script online which converts a file from one specific extension to another, I am trying to utilize subprocess.call
and have had no luck so far.
I am trying to use subprocess.call
to convert a file in a directory.
I successfully managed to perform this in the terminal and am now trying to execute this in python as part of a program.
For the arguments, I am giving 'python' the name of the script, the file I want to convert and then the new name once it has been converted.
subprocess.call(["python", "converter.py", "file1.txt", ">", "file1converted.xml"])
Am I using subprocess.call
in the correct manner? I can't seem to find anywhere on how to perform what I'm trying to do, also if possible I would like to find out a way on how I can convert a file without specifying the new name after conversion, but instead using change the 'file1.txt' to '.xml' once done.