Python-SideNotes - Module 1
Python-SideNotes - Module 1
DEMO
Accessing the Interpreter
Console provides a command-line interface to the interpreter
• Executes commands interactively
• Has a built-in help system
Statements are executed in the same manner as when run from a file
• Enables testing as you write
• Copy code from an editor and paste into the console
In this course, there are two interfaces to the command interpreter
• Launch the IDLE application from a taskbar button
• Launch the console from a taskbar button
The Python Interpreter
Executes Source code statements.
• Entered interactively from a console or read from a text file.
Runtime environment
Source code file:
hw.py
Hello World
Python interpreter
print "Hello World"
The Python Interpreter
Can optionally create byte code
•Byte code is machine architecture independent.
•Byte code files have .pyc extension.
Byte Code is executed by the Python Virtual Machine (PVM).
•Operating System Dependent.
Byte code file:
Source code file:
hw.py hw.pyc
Python interpreter
print "Hello World" 10011101101001
PVM
Runtime environment
Hello World