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
  encrypt data in json file help jacksfrustration 1 188 Mar-28-2024, 05:16 PM
Last Post: deanhystad
  parse json field from csv file lebossejames 4 724 Nov-14-2023, 11:34 PM
Last Post: snippsat
  Navigating file directories and paths inside Jupyter Notebook Mark17 5 682 Oct-29-2023, 12:40 PM
Last Post: Mark17
  How do I handle escape character in parameter arguments in Python? JKR 6 1,124 Sep-12-2023, 03:00 AM
Last Post: Apoed2023
  Need to replace a string with a file (HTML file) tester_V 1 754 Aug-30-2023, 03:42 AM
Last Post: Larz60+
  Python Script to convert Json to CSV file chvsnarayana 8 2,489 Apr-26-2023, 10:31 PM
Last Post: DeaD_EyE
  Loop through json file and reset values [SOLVED] AlphaInc 2 2,083 Apr-06-2023, 11:15 AM
Last Post: AlphaInc
  [split] Parse Nested JSON String in Python mmm07 4 1,518 Mar-28-2023, 06:07 PM
Last Post: snippsat
  Converting a json file to a dataframe with rows and columns eyavuz21 13 4,377 Jan-29-2023, 03:59 PM
Last Post: eyavuz21
  [ERROR] ParamValidationError: Parameter validation failed: Invalid type for parameter gdbengo 3 10,938 Dec-26-2022, 08:48 AM
Last Post: ibreeden

Forum Jump:

User Panel Messages

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