Presentation on basics of computer programming and programming Raspberry Pi's using the Python Programming Language at the Raspberry Pi Demo Day at Toronto Reference Library on May 28, 2016.
1950’s - 1960’s Business
No Command Line Interface
1990’s Personal
Graphical User Interface (GUI)
Command Line Computer Interface
1970’s Personal
Command Line Interface Only
(Sometimes called Shell Or Console)
Hardware Specific, Very Fast But
Very Difficult For Human
Comprehension. This Is The Language
That The Computer Speaks.
ARM Cortex-A53 CPU
How Does Programming Work?
High Level Languages Are Considered
Cross Platform and Comprehendible.
To Maintain Speed They Compile An
Assembly Or Machine Language
Version Of The Code Specifically
For The CPU.
ARM Cortex-A53 CPU
Quality Compilers Can Generate Quicker Code
C Often Used In Graphics and Operating Systems
How Does Programming Work?
ARM Cortex-A53 CPU
Quality Compilers Can Generate Quicker Code
C Often Used In Graphics and Operating Systems
How Does Programming Work?
ARM Cortex-A53 CPU
PYTHON BASIC
Dynamic high-level general-purpose
scripting languages (such as Python
and PERL) execute programs in real
time using pre-compiled API’s or
machine code. Their advantage is
that programs can be be constructed
from pre built blocks and combined
into complex programs.
PERL
Software Intermediary
How Does Programming Work?
How Does Programming Work?
ARM Cortex-A53 CPU - Linux
PYTHON CODE
Python Virtual Machine
Bytecode
How Does Programming Work?
PYTHON CODE
ARM Cortex-A53 CPU - Linux
Python Virtual Machine
AMD Athlon™ X4 CPU - Windows
Python Virtual Machine
Intel® Core™ i7 CPU - MAC OSX
Python Virtual Machine
Why Python?
● Python Is A General Purpose Language
○ Many computer devices
○ Libraries for most applications.
● Large Standard Code Library
○ Standard Library runs on Raspberry Pi or CRAY Supercomputer.
● Can Be Compiled To Machine Language
○ Cython compiles Python code To C.
● Can Call C Code
○ Python ctypes
● Clean code
○ Employs indentation
○ No {..code in here..} or <div>..or stuff in here..<div>
● Libraries, Libraries, Libraries
○ The secret power of Python
○ 67,000 libraries (Jan 1, 2016)
Getting Started On Raspberry Pi
● https://www.raspberrypi.org/documentation/usage/python/
○ RUNNING PYTHON ON A RASPBERRY PI
○ INDENTATION
○ VARIABLES
○ COMMENTS
○ LISTS
○ ITERATION and RANGE
○ CREATING/SAVING PYTHON FILES
○ EXECUTING PYTHON FILES
Review
PYTHON CODE
ARM Cortex-A53 CPU - Linux
Python Virtual Machine
AMD Athlon™ X4 CPU - Windows
Python Virtual Machine
Intel® Core™ i7 CPU - MAC OSX
Python Virtual Machine