0

I'm trying to use an external program which converts a file to another specific file type.

I've been trying to find out how to perform this in python, I can successfully execute the commands in the command line but when I'm trying to use Python I'm having some problems.

This is my current code I am using but I get an error in the terminal saying:

unrecognized arguments: > test.xml

In python, I am stating 'python' the script 'file_convert.py' and the target file to be converted.

import subprocess

subprocess.call("python", "file_convert.py", "targetfile.txt", ">", "test.xml"])
saeed foroughi
  • 1,662
  • 1
  • 13
  • 25
ghostlyP
  • 3
  • 2

0 Answers0