Run python source file from PowerShell

前端 未结 6 426
伪装坚强ぢ
伪装坚强ぢ 2021-01-19 16:28

I\'m trying to learn python but have some problem running source files from power shell. When I type \'python\' it opens up and I can type python commands directly in the sh

6条回答
  •  失恋的感觉
    2021-01-19 16:55

    Disclaimer: I don't know PowerShell, but I do know cmd.exe.

    I don't know why python myfile.py doesn't work, but assuming that PowerShell bears at least some similarity to cmd.exe, the following should probably work: myfile.py. That's right, just enter the name of the Python script and hit enter.

提交回复
热议问题