Python Forum

Full Version: Python Parameter inside Json file treated as String
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I have a Python Script which extracts the data from XL sheet(using Pandas) and finally renames the Output file name into other name.
My config file is in JSON format.
I am passing the 'mv' command as one of parameter in Json file. I am passing Date as the Third argument. Here is how the code(Ignored the other part like data extraction, reading from Json etc. of Python Script, as it was working fine) looks like

import subprocess

File_date=sys.argv[3]

subprocess.Popen(run_cmd)
Json Config for File rename:
"run_cmd": ["mv", "directory/Old_File_name + File_date ", "directory/New_File_name + File_date"]

Kindly help me in this