I want to run a batch file that uses a python script. The python script needs a date as key input.
I tried the following based on what I saw here (Sending arguments from Batch file to Python script)
@echo off
set /p data_valori=Insert date (format yyyy/mm/dd) :
"C:\Program Files\Anaconda3\python.exe" "S:\pricing\Python\new scarico Market Data ASW_PER_DATA_CUSTOM.py" %data_valori%
My python script then does the following:
import sys
data_valori = str(sys.argv[1])
I manage to insert the input in the cmd window but then it never calls python (from what I see) and it just closes the cmd window.
I tried different options for calling python, such as
python new scarico Market Data ASW_PER_DATA_CUSTOM.py %data_valori%
It still closes the cmd after inputting.