I am trying to run a program that I coded in the Python-IDLE in the command prompt of windows. So I watched a video on Youtube which showed me that, but it did not work. From the video I learned how to run IDLE code using a batch file. So I created a batch file in the Python IDLE and put it in the same folder in which I put the program I created with the Python IDLE. Then I used the windows (Run) command to run the batch file and the command prompt gave me an error message.
I have already tried not using the windows run command, (Win+R), but searching the command prompt in the windows search bar and then running the program which I created in the Python_IDLE in the Command Prompt, and that gave me the exact same error message.
This is the program I tried to run:
name = input('Input your name: ')
age = input('Input your birth year: ')
print(f'Hello {name}, I know you are {age} years old')
This is the error message I got (in the command prompt):
no such file or directory
This is what I wrote in the Python-IDLE to create the batch file:
@py C:\Users\Angelo Hoft\PyProjects\Greeting.py %*
@pause
And this is the command I entered in the windows (Run) tab:
C:\Users\Angelo Hoft\PyProjects\hello.bat
Angelo Hoft is the user of the computer I am using, PyProjects is the folder in which I stored the batch file and the Python-IDLE Program I am trying to run in the command prompt
But I just want my program to ask the user for input and then make a sentence out of it which contains the user's name and age.
no such file or directorycomes from the Windows command processor, not python. User 'magoo' addressed that.