Skip to content Skip to sidebar Skip to footer

How To Run Standalone Files In PyCharm

I'm doing small time project development using PyCharm. I use Pycharm for its intellisense features. As I develop each piece of code, I like to run it occasionally to test it. All

Solution 1:

You can simply choose the 'Run' entry in the context menu for the file in the Project view:

enter image description here

This will run the file exactly as if you had entered

python

from the command line, in the directory containing the file.

The first time you do this an entry is also added to the toolbar, which allows you to run the file with a single click

enter image description here

and provides options for customizing a range of options supplied automatically each time you run.


Solution 2:

I just came across the same problem. It was because it had a class called TestClass in the file. I changed the name of the class and then I was able to run the file as normal.


Post a Comment for "How To Run Standalone Files In PyCharm"