© 2019 BrainStemSchool.com

December 13, 2016

December 9, 2016

December 7, 2016

Please reload

How Python Works

November 11, 2016

Languages can be interpreted, compiled, or somewhere in-between.

 

Python is an interpreted language.

 

This means that it exists in source code - plain text form. The interpreter, another program, reads the source code and interprets or executes the commands line by line.

 

Python can run in one of two modes:

  1. Interactive or Immediate Mode

  2. Interpreter or Script Mode

Interactive Mode 

In interactive mode you are greeted with the famous Python prompt:

 

>>>

 

A prompt is a signal to the user that the computer is waiting for keyboard input.

 

The programmer inserts commands one at a time. After each instruction, the computer responds with an action.

 

Interactive mode is very useful for trying out commands and doing simple tasks.

Interpreter Mode

The programmer composes an entire program in interpreter mode. The program is a list of commands in a plain text source code document. 

 

After the program is composed, the user runs the program by feeding the document to the Python interpreter.

 

The interpreter reads the script line by line and executes each command in batch - that means as it was programmed without human intervention.

 

This is more traditional "programming" and is very useful for performing complex and frequently repeated tasks.

 

Next Post: Installing Python

Share on Facebook
Share on Twitter
Please reload

Please reload

Recent Posts
Tags