How to run a python program in Windows 10 command prompt

前端 未结 2 1473
遇见更好的自我
遇见更好的自我 2021-01-20 14:13

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\"<

相关标签:
2条回答
  • 2021-01-20 14:26

    Try this in your command prompt:

    python3 hello.py
    
    0 讨论(0)
  • 2021-01-20 14:31

    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:
    0 讨论(0)
提交回复
热议问题