Learn Simpli

Free Online Tutorial For Programmers, Contains a Solution For Question in Programming. Quizzes and Practice / Company / Test interview Questions.

How to run python scriptHow to run python script

In this chapter, we will learn how to run the python script. If you are using the mac go to the python downloader for mac and download the installer and run it. If you are using the windows then go to the python downloader for windows and download the installer run it.

For learning purposes, you can also use the python online compilers like online python compiler, online python compiler.

Let’s run our first python script, create a directory pythonScript and inside directory create the file helloWorld.py and paste the below code

# Welcome to python course
print('Hello, welcome to python course')

Now in the mac os open the terminal point to your pythonScript directory and run the below command
python helloWorld.py

You should see the below output

How to run python script code snippet

One thought on “How to run python script

Comments are closed.