zaro

How to Create a New Python File in PyCharm?

Published in PyCharm IDE 1 min read

To create a new Python file in PyCharm, follow these steps:

  1. Locate the Project Tool Window: This window displays your project's file structure. It's typically located on the left side of the PyCharm interface.

  2. Select the Project Root: In the Project tool window, click on the root node of your project. This is usually the top-level folder representing your project.

  3. Right-Click and Select "New": Right-click on the selected project root. A context menu will appear.

  4. Choose "Python File": From the context menu, navigate to New > Python File.

  5. Enter the Filename: A dialog box will appear, prompting you to enter the desired filename for your new Python file. Type the name (e.g., my_script.py) and press Enter.

PyCharm will then create the new Python file and automatically open it in the editor, ready for you to start coding.