Azad Rasul
SmartRS

SmartRS

5- Run a Python program

Azad Rasul's photo
Azad Rasul

Published on Jun 26, 2021

1 min read

Subscribe to my newsletter and never miss my upcoming articles

For short commands, we do not need to write scripts. We use command line: In the search window of Windows write:

cmd

Then click Enter to open command prompt.

To open Python, inside the command prompt write:

python
print("Hellow World!")
### Hellow World!

To close the Python use:

exit()

Write a simple python file

Open Notepad, inside notepad, write: print("Hello, World!"), then save it as: helloworld.py

To run a python file on the command line: Change the directory to the folder (e.i. Python38) that includes the file. then we use command: python file-name.py

cd C:\Python38

python helloworld.py
### Hello, World!

hellowworld is the name of the file.

Congratulations, you have written and executed your first Python program.

 
Share this
Proudly part of