Python is called Cross Platform Language, meaning you can Install and run it on Windows, Linux, and Mac osX operating system very easily. Now I will show here the simple method of how to Install Python and Run Python on your own computer (Windows Operating system).
Installing and Running Python on Windows
Download Python by going to Python’s official site Download Python page and clicking on Download Python 3.10.6.
Once the download is complete, double-click the file and follow the instructions to install Python.
Click on Customize Installation and select all the options as below:
Now click on Next and select all the options as below.
Once the Python installation is complete, a program called IDLE will be installed along with it. It is basically a Graphical User Interface (GUI) through which you can run Python code.
Open IDLE and copy the following code and press Enter.
print ("Hello, World!")
You should see an output just like below:
IDLE GUI allows you to save and run Python code in a separate file. And for this you need to open a new file by going to File=>New File in IDLE GUI and save the new file with .py extension, just like below:
Now paste the following code in your file with .py extension.
print("Hello Python! I'm String from a file")
Then press F5 or click Run Module. Just like below:
Now you will see the result below:
Run Python code from the Windows Command Prompt
But apart from IDLE GUI, you can run Python code directly from Windows Command Prompt, for this, you need to go to your Command Prompt and need to write just python, just like below:
Now you can freely run the python code, see the below screenshot:
Like the IDLE GUI, you can run the Python file from the Command Prompt, and for this, you just need to access the location where you have saved the .py file with the DOS cd command, then type python fileName.py and enter. Check out the screenshot below:
Hi, My name is Masud Alam, love to work with Open Source Technologies, living in Dhaka, Bangladesh. I’m a Certified Engineer on ZEND PHP 5.3, I served my first Fifteen years a number of leadership positions at AmarBebsha Ltd as a CTO, Winux Soft Ltd, SSL Wireless Ltd, Canadian International Development Agency (CIDA), World Vision, Care Bangladesh, Helen Keller, US AID and MAX Group where I worked on ERP software and web development., but now I’m a founder and CEO of TechBeeo Software Company Ltd. I’m also a Course Instructor of ZCPE PHP 7 Certification and professional web development course at w3programmers Training Institute – a leading Training Institute in the country.