A Python-specific Integrated Development Environment (IDE) called PyCharm offers a large range of crucial features for Python developers.
Python programming can be done using the integrated development environment PyCharm. In addition to supporting Django web development, it offers code analysis, a graphical debugger, an integrated unit tester, integration with version control systems, and more. The JetBrains firm in the Czech Republic creates PyCharm.
In this post we will discuss how to create and run a python program using PyCharm. For this we need to follow below simple steps:
- Install Python
- Install PyCharm
- Open PyCharm on your computer. It will show the interface like below image.
Go to top left menu. Select File–>New Project
Under the new project templates, select “Pure Python”, then select the path or location where you want to keep this project files. Add the name of the project( here MyProject) at the end of the location or path.
Select the base interpreter, which is python exe location on your computer.
Then click create.
Then a popup may appear as below, preferably select “This Window”.
The new project named “MyProject” will be created and displayed in the left window. Note that it has a virtual environment created named venv.
Right click on the MyProject–> New–>Python File to add a new python file to your project.
A pop up will appear for naming the upcoming python file. Name it, for example “HelloWorld” and hit enter.
The HelloWorld.py file is created in the my project folder. Write a small one line program in this file. For example print(“Hello World”).
Go to the top Run menu. Click on it and select Run.
The python program is run and the output “Hello World” is displayed in the run tab at the bottom as shown in the image below.
Congratulations!! you just ran your first python program in PyCharm.