I am trying to run a python script from another python script but i am getting blocked because there is a space in the passed argument. The script I am trying to run is ran from the command terminal with the name and the arguments as such
>>>Duplicate_Checki.py "Google Control Center" "7.5 Hardening"
In the script which i try to call the first script the code looks like this:
def run_duplicate_check(self):
os.system("python Duplicate_Checki.py Google Control Center 7.5 Hardening")
I get the following error
Duplicate_Checki.py: error: unrecognized arguments: Center 7.5 Hardening
Also tried
os.system("python Duplicate_Checki.py {} {}".format("Google Control Center" ,"7.5 Hardening")) with the same error
I have also tried
os.system(python Duplicate_Checki.py "Google Control Center" "7.5 Hardening")
but i get invalid syntax
os.system('python Duplicate_Checki.py "Google\ Control\ Center 7.5\ Hardening"')subprocess.run. It doesn't do any splitting on spaces.