Movatterモバイル変換


[0]ホーム

URL:


Loading video player…

Overview and the Python Interpreter

Learn what the Python interpreter is and how it translates the code you write into a language the computer can understand. You’ll also learn about the different implementations of Python and how the interpreter processes scripts.

Take the Quiz: Test your knowledge with our interactive “How to Run Your Python Scripts” quiz. You’ll receive a score upon completion to help you track your learning progress:


How to Run Your Python Scripts

Interactive Quiz

How to Run Your Python Scripts

One of the most important skills you need to build as a Python developer is to be able to run Python scripts and code. Test your understanding on how good you are with running your code.

00:00Hi, I’m Darren from Real Python. In these videos,you’re going to see how to run your Python scripts.

00:06You’ll look at the Python interpreter,

00:08the differences between modules and scripts, how to run code interactively,how to run code from the command line,how to run code from a file manager, and how to run code from your IDE or texteditor.

00:24Let’s start out by looking at the Python interpreter.What is the Python interpreter? While the Python interpreter takes the code thatyou write and converts it into the language that the computer’s hardwareunderstands,the computer doesn’t actually understand Python at the lowest level, and Python’sinterpreter translates the code into a languagethe computer does understand—the 0s and 1s, bits and bytesthat computers actually run on. This process is done every time you run a Pythonscript,so unlike a compiled language where an executable file is made, each time youneed the Python interpreter to do the work for you.

00:57And that’s why you need Python installed on any computeryou want to run a script on.

01:01There are a number of implementations of Python. There’s CPython, the referenceimplementation of the Python language,which you may well have downloaded already from python.org. There’s Jython,which is written in Java. There’s PyPy,which is written in Python and can offer improved speed and memory use;IronPython, which targets Microsoft’s .NET platform;and MicroPython, which runs on microcontrollers, so it can run on small,low-cost hardware and IoT devices. But how does Python actually run a script?

01:34First, it processes the statements of the script and checks for correct syntax,et cetera.Then it compiles the source code to bytecode—an intermediate, platform-independentversion of the code that you’ve written. Next,it ships that code off for execution,and this is where the Python Virtual Machine comes into play,which actually runs the code that you’ve written at the lowest level.

Avatar image for bhumikalamba

bhumikalamba onNov. 29, 2019

what is meant by Python Implementations ?

Become a Member to join the conversation.

Course Contents

Overview
12%

[8]ページ先頭

©2009-2026 Movatter.jp