问题
I am getting as such error for executing my hello world program:
"This file does not have a program associated with it for performing this action"
回答1:
1) Download the official version of Python
2) Use custom installation following the screenshots bellow.
3) Run your hello.py
file directly from the command line by typing hello.py
- Screenshots #1
- Screenshots #2
- Screenshots #3
- I have this python code that I'm running on just by typing Q60471933.py
from datetime import datetime
print("\nHello World\n",datetime.now().strftime("\b%m/%d/%Y\n%H:%M:%S"))
- Outputs:
回答2:
Try this in your command prompt:
python3 hello.py
来源:https://stackoverflow.com/questions/60471933/how-to-run-a-python-program-in-windows-10-command-prompt