How to Create a Program in Python (Using IDLE & Notepad)

Create a Program in Python Using IDLE:

(1) In the previous blog we will discuss how to install PyCharm for Python and create a program in it. PyCharm is the code editor for Python. In this blog, we can learn how to create a program in Python’s own code editor.

(2) For this go to the windows search bar and type “IDLE” which is Python’s own code editor and Open it as shown below.

Python Idle Open
Python IDLE Editor

(3) Now we can write a simple program in IDLE. After writing the program in IDLE, you simply have to press the enter key on your keyboard and your output will be displayed below the program as shown below.

Idle first program

Create a Program in Python Using Notepad:

(1) Now we will learn how to create a program in python using notepad and how to run it. For this, we have created a new folder on the desktop and created a new file in it using the extension “.py“.

create new file in python folder
py extension file created

Note: If your computer does not recognize the “.py” extension, then do the following settings on your computer system as shown below.

  • Search File Explorer Options on the Windows search bar.
Open File Explorer Options in Computer
  • Go to the View tab and untick the “Hide extensions for known file types” and then click on Apply button as shown below.
hide extensions for known file types in computer
  • Now your computer recognizes the “.py” extension.

(2) Now right-click on the “” file and open it with Notepad as shown below.

open python file with notepad

(3) Write code in it and save the file as shown below.

first python code in notepad
python code file save

(4) Now we have to run the code. For this open the command prompt and go to the directory where you have created the folder as shown below.

python project properties
location of python project

The above image shows the location of the Python Project Folder which is created on the desktop. We have to enter this folder by using the command prompt. So we use the cd command so that we can enter the specified path where the folder is created. When we enter the Python Project Folder using the cd command then we use the python command to run the program as shown below.

cmd python output of code

MySQL Tutorial
Install Python on Windows
How to Install PyCharm For Python on Windows
Client-Server Architecture
Wireless Networking
What is Virtual Reality?
Cloud Computing
Python (programming language)– Wikipedia

Comments (No)

Leave a Reply