• Home
  • Twitter Trends
  • HTML & CSS
  • JavaScript
  • React.js
  • Blog

Thecuriouscorp

Thecuriouscorp is a source of amazing articles, free codes, designs, examples, and tutorials about web development. A free resource for web developers.

How to Run Python Programs Easily

In the learning process, you are going to run Python programs many times. There are many ways by which you can run python scripts or programs. As a beginner, you should focus on running Python programs easy way.

This tutorial will tell you different ways to run a Python program. You should learn all of them. Then you can choose whichever method you like. I will suggest that you should use the command line to run Python programs.

Python programs are run using a Python interpreter. Python interpreter comes along with the python bundle.  we downloaded this bundle in the previous lesson. 

If you haven’t installed Python yet then you should check the previous tutorial. Tutorial as a detailed guide how you can install Python3 properly.

Run Python Programs Using Command Line in Windows

run oython program in windows command line

Command-Line in Windows is amazing. You can do much stuff with the windows command line. Although, it has many different commands. We don’t need all of that. You just need basic CMD commands. You will use these commands to browse through the folders, etc. We don’t need all of the commands.

Below are the commands which you will use mostly.

  • cd : This command is known as change directory. The command is used to change directory. If you want to change directory to a different location, you can do it with this command. This command will useful if have programs in subfolders and different folders.
  • cd.. : Adding two full stops after cd command will take one level of the directory. It will take you one folder back of the current folder.
  • cls : It is known as Clear Screen command. Cls command is used to clear the screen when required.
  • dir : dire stands for directory command. This command lists all the directory in the current working path.

Run Python Programs in Mac OS Terminal

run python program using mac os terminal

Mac Os is based on UNIX. It has terminal like windows. Mac OS Terminal has different commands. Again, you don’t require all of them. You just need the basic ones.

Basic commands for changing directory and clear screen commands are enough.

For Mac OS terminal you can learn following commands.

  • pwd : pwd command prints the current working directory on the terminal. It will be useful for knowing which directory you are working on.
  • cd : cd command means change directory. This is the same as the windows cmd command. Change the path of the terminal with the change directory command.
  • ls : ls command lists all the files and folders in the current directory. You don’t have to go to the file manager every time.
  • clear : clear command clears everything on the terminal.

Online Python Interpreter

run python program using online interpreter

Online Python Interpreter are that you can use to run python programs. You don’t have to install anything on your PC. You can just go to the link and start writing and running your programs. It is good when you are working on smaller programs.

But when you start working with files and other complex programs, it becomes difficult to do it online. If you are starting out you can use online interpreter.

Some of the online python interpreter that I like.

  • CodeChef Online IDE
  • Repl.it

Run Python Programs using IDEs

Standalone IDEs are available in the market. They have python interpreter built into the software. So you write python programs and run along the way. Just click a button and you are done.

Anaconda is one of the most popular IDE that is available for Python. For Anaconda, you have to download and install the package. Anaconda IDE is quite heavy.

Conclusion

These are some of the methods which you can use to run programs in Python. Now it is up to you whichever method you like you can use. My recommendation would be to use the command line for now. After that you can change for whatever you like.

Previous -> Python Programming Lab Setup
Next -> Why can’t I comment on YouTube Videos 2022 (Fix)

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Important Links

  • Home
  • Blog
  • About Us
  • Disclaimer
  • Privacy Policy
  • DMCA
  • Contact Us

About Us

Thecuriouscorp is a source of amazing articles, free codes, designs, examples, and tutorials about web development. A free resource for web developers.

All Logos and Images are Trademarks of their respective owners. Thecuriouscorp makes no claim on these Trademarks.

Follow Us

Facebook
Pinterest
Twitter

Copyright © 2023 Thecuriouscorp.com

We use cookies on our website to give you the most relevant experience by remembering your preferences and repeat visits. By clicking “Got It!”, you consent to the use of ALL the cookies.
Got It!
Privacy & Cookies Policy

Privacy Overview

This website uses cookies to improve your experience while you navigate through the website. Out of these cookies, the cookies that are categorized as necessary are stored on your browser as they are essential for the working of basic functionalities of the website. We also use third-party cookies that help us analyze and understand how you use this website. These cookies will be stored in your browser only with your consent. You also have the option to opt-out of these cookies. But opting out of some of these cookies may have an effect on your browsing experience.
Necessary
Always Enabled
Necessary cookies are absolutely essential for the website to function properly. This category only includes cookies that ensures basic functionalities and security features of the website. These cookies do not store any personal information.
Non-necessary
Any cookies that may not be particularly necessary for the website to function and is used specifically to collect user personal data via analytics, ads, other embedded contents are termed as non-necessary cookies. It is mandatory to procure user consent prior to running these cookies on your website.
SAVE & ACCEPT