How to run an existing py. file via console (cmd); ?
How to run an existing python file in PyCharm?

  • in the console, write python main.py , in pycharm: in the menu File-> Open ... and choose your file, or File-> New .... Also, for pycharm try dragging that .py file and throw it into the ide window - gil9red

1 answer 1

In pycharm: in the menu File-> Open and select your file, to run the script, go to the menu Run -> Run 'File name' or Run ...

  • To start pycharm, you can also use Ctrl + Shift + F10 - gil9red