Setup Python and Environment Variables

Its difficult for fresher or someone who wants to start, setup python and run Hello World program. This is a complete guide which will help to setup python, its environment variables and run simple hello world program.

Lets first verify if python installed or not in local. To test the same type python or py in command prompt and press enter. It will say Python was not found if it is not installed.

Steps to Setup Python

  1. To setup Python open link.

2. Select windows installed as 32 or 64 bit. I am going to select below highlighted first option as my system is 64 bit to install 3.10.6.

3. Go to download folder and double click on the downloaded file.

4. Below popup will appear, click on install Now to install Python.

5. It will show below screen if Python installation is in progress

6. We will see below screen once the Python installation is successfully done.

7. Open command prompt and enter py will show below message with installed Python version.

8. Open command prompt window and type py will start python editor. Write below code in command prompt and press enter should give output as “Hello World !!!” as mentioned in below screen shot.

print(“Hello World !!!”);

Set environment Variable:

  1. Go to control panel -> Advanced system settings or directly search for environment variables.

2. Click on Environment Variables.

3. Inside System variables select path properties and click on Edit.

4. add below line in path variable and click on ok:

C:\Users\<user_name>\AppData\Local\Microsoft\WindowsApps

Hello World Program

Let’s check if environment variable got set correctly.

Create a new file with the name and extension as py.

e.g. -> hello.py

Please save below code in hello.py:

print(“Hello World !!!”);

Go inside that folder where we created hello.py file and open command prompt.

Run “py hello.py” command in command prompt as shown below will run the code and give output.

Imran Khan, Adobe Community Advisor, AEM certified developer and Java Geek, is an experienced AEM developer with over 11 years of expertise in designing and implementing robust web applications. He leverages Adobe Experience Manager, Analytics, and Target to create dynamic digital experiences. Imran possesses extensive expertise in J2EE, Sightly, Struts 2.0, Spring, Hibernate, JPA, React, HTML, jQuery, and JavaScript.

0