Python Hello World!

by BryanSu in Circuits > Software

7336 Views, 5 Favorites, 0 Comments

Python Hello World!

python-logo-master-v3-TM-flattened.png

This is a step by step tutorial on creating a simple Python program using PyCharm Community Edition.

Download PyCharm Community Edition

step1.png

PyCharm can be downloaded from the JetBrains website for free at the following link:

https://www.jetbrains.com/pycharm/download/#sectio...

To download the PyCharm Community Edition, Simply click on the black download button.

Find the Installation File

step2.png

When PyCharm has finished downloading, you should be able to find the installation file in your Downloads folder.

Double click on the PyCharm installation file.

Installation

step3.png
step4.png
step5.png
step6.png
step7.png

When the installation is opened you will be presented with the PyCharm Community Edition Setup window.

The first screen presents an introduction.

Click Next.

The second screen is used to select an installation location. This is useful if your computer is low on space.

Select where you want PyCharm to be installed and click Next.

The third screen presents shortcut options and gives the option to associate .py files with the PyCharm program.

This means that if a file with the extension .py is opened on your computer, it would attempt to open the file using PyCharm.

Click Next.

The fourth screen is used to create a Menu Folder for PyCharm.

Click Next.

The fifth screen will confirm that PyCharm was successfully installed.

Check the box next to "Run PyCharm Community Edition"

Then Click Next.

Initial Setup

step8.png
step9.png

When PyCharm is opened for the first time, a initial configuration window will be presented.

This window allows the user to change some aesthetic attributes of the PyCharm program.

Click OK.

The Initial configuration window will disappear and you will see the Welcome screen.

Click on "Create New Project" to begin creating your program.

Create a Project

step10.png
step11.png

You will now be presented with the New Project window.

The default location will include "untitled" at the end.

This location can be changed to almost anything you want but we will change it to "myfirstprogram".

Click Create.

Create a Python File

step12zoom.png
step13zoom.png
step14zoom.png

PyCharm and other IDEs (Integrated Development Environment) usually open with a "Tip of the day" window. These are more useful for experienced programmers, usually tips pertaining to shortcuts which speed up the programming process are given.

Go ahead and close the "Tip of the day" window.

In order to create our python file where we want it, we right click on the myfirstprogram folder, hover over new, then select Python File.

This will open up a "New Python File" window in which you can name the file.

Let's name it "HelloWorld" and select OK.

Code Your Program

step15zoom.png

Python is a very powerful programming language which allows the programmer to complete a lot using very little code.

For our simple program we will only need one line of code:

print("Hello, World!")

Type this into the HelloWorld.py and we will be ready to run our program.

Run Your Program

step16zoom.png
step17zoom.png
step18zoom.png

Click Run at the top of the screen.

Click Run on the drop down menu.

Click HelloWorld on the Window that appears.

Your program will now run on the bottom of the screen.

CONGRATULATIONS! You have completed your very first Python program!