Oct-26-2022, 03:48 PM
Hi Team,
I am running this script via command line it is working.
python test.py sql_Table1 "\\IND200300400.XXX.XXXX.XXX\Recon Project\output1"
But below code when I try to run multiple py files from single py , code is not working.
it is because of space issue in output folder path ----> "Recon Project"
it is considering Seperate argument. but its single argument of output folder path.
"\\IND200300400.XXX.XXXX.XXX\Recon"
"Project\output1"
I am running this script via command line it is working.
python test.py sql_Table1 "\\IND200300400.XXX.XXXX.XXX\Recon Project\output1"
But below code when I try to run multiple py files from single py , code is not working.
it is because of space issue in output folder path ----> "Recon Project"
it is considering Seperate argument. but its single argument of output folder path.
"\\IND200300400.XXX.XXXX.XXX\Recon"
"Project\output1"
from pathlib import Path
import sys
this_dir = Path(__file__).parent
for args in [
"test.py sql_Table1 \\IND200300400.XXX.XXXX.XXX\Recon Project\output1",
"test.py sql_Table2 \\IND200300400.XXX.XXXX.XXX\Recon Project\output2",
"test.py sql_Table3 \\IND200300400.XXX.XXXX.XXX\Recon Project\output3"]:
args = args.split()
filename = this_dir/args[0]
args[0] = str(filename)
sys.argv[:] = args
namespace = {'__name__': '__main__'}
exec(filename.read_text(), namespace)
