Python Forum
Python Parameter inside Json file treated as String
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Python Parameter inside Json file treated as String
#1
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
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Errors using json file RonR 5 955 Oct-28-2025, 03:00 PM
Last Post: buran
  get JSON string from URL with Windows credentials shwfgd 0 1,097 Aug-27-2024, 10:08 PM
Last Post: shwfgd
  JSON File - extract only the data in a nested array for CSV file shwfgd 2 2,250 Aug-26-2024, 10:14 PM
Last Post: shwfgd
  encrypt data in json file help jacksfrustration 1 3,568 Mar-28-2024, 05:16 PM
Last Post: deanhystad
  parse json field from csv file lebossejames 4 3,004 Nov-14-2023, 11:34 PM
Last Post: snippsat
  Navigating file directories and paths inside Jupyter Notebook Mark17 5 20,676 Oct-29-2023, 12:40 PM
Last Post: Mark17
  How do I handle escape character in parameter arguments in Python? JKR 6 8,428 Sep-12-2023, 03:00 AM
Last Post: Apoed2023
  Need to replace a string with a file (HTML file) tester_V 1 3,016 Aug-30-2023, 03:42 AM
Last Post: Larz60+
  Python Script to convert Json to CSV file chvsnarayana 8 6,403 Apr-26-2023, 10:31 PM
Last Post: DeaD_EyE
  Loop through json file and reset values [SOLVED] AlphaInc 2 7,587 Apr-06-2023, 11:15 AM
Last Post: AlphaInc

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020