


Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Community
Ask the community for help and clear up your study doubts
Discover the best universities in your country according to Docsity users
Free resources
Download our free guides on studying techniques, anxiety management strategies, and thesis advice from Docsity tutors
A tutorial on how to run Python programs. It explains what Python is, its uses, and how to execute Python scripts using different methods. The document also describes the Python interpreter and its role in executing Python scripts. It is a useful guide for beginners who want to learn Python programming.
Typology: Lecture notes
1 / 4
This page cannot be seen from the preview
Don't miss anything!
Python Program Tutorial University of the Philippines How to run Python Program What is Python? Python is an interpreted, general-purpose, high-level programming language that is often used in system administration and web development. Python is an interpreted scripting language also. Guido Van Rossum is known as the founder of Python programming. Python isn't intended to work in a specific area such as web programming. For this reason, it is known as a general-purpose programming language that can be used for web, enterprise, 3D CAD, and more. Python makes the development and debugging fast because there is no compilation step included in Python development, and edit-test-debug cycle is very fast. How to run Python Program? A Python programmer should know all the ways to run a Python script or code. This is the only way to check if the code works as intended. Interpreter is responsible for executing the Python scripts. Python interpreter is a piece of software which works between the Python program and computer hardware. Here we are describing the series of ways to run Python scripts.
We write the Python print statement and save it as sample.py in working directory. Now, we will run this file using the command-line. Using the Python command line Open a command line and run the Python script. To run the file, you need to enter the file name after python. Now press Enter. If there are no errors in the file, you will see output similar to the following: The Python interactive mode To run Python code, you can use a Python interactive session. You should start an interactive python session. Open a command line or terminal from the start menu, type python and press enter. Here is the example of how to run Python code using interactive shell. print(“Tian Bern”)
Click the green button and you should see the output like this: The file manager system Python files can be run by double-clicking their icon in the file manager. This procedure cannot be used widely during the development phase. This file should be associated with a .py or .pyw file using the python.exe program.