I have a new.py file that i use to automate a procedure. I want to add a user input in the script which will be saved as a variable.
username = input("Please enter username:")
while username not in users:
print("Incorrect Username")
username = input("Please enter username:")
print("Username Accepted")
But when i execute my new.py file using a batch file which is as follows:
cmd /c C:\ProgramData\Anaconda3\condabin\conda.bat run "C:\ProgramData\Anaconda3\python.exe"
"C:\Users\mbeig\Downloads\new.py"
pause
I get an error saying:
Please enter username:
Traceback (most recent call last):
File "C:\Users\mbeig\Downloads\new.py", line 39, in <module>
username = input("Please enter username:")
EOFError: EOF when reading a line
I want the user to enter an input in command line which can be used as variable in the script. Thanks!