To create a new Python file in PyCharm, follow these steps:
-
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.
-
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.
-
Right-Click and Select "New": Right-click on the selected project root. A context menu will appear.
-
Choose "Python File": From the context menu, navigate to
New > Python File
. -
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.