Download presentation
Presentation is loading. Please wait.
1
Building Raspberry Pi Controllers with Python
Class 2: Introduction to the Python Programming Language July 7, 2015 Don Wilcher
2
Introduction to the Python Programming Language
Day 2 Agenda: Concepts of the Python Programming Language Review of the Python IDLE and shell sudo Python IDLE and shell Coding with Python using interpretive programming Building a simple calculator
3
Introduction to the Python Programming Language
Learning Objectives: Learn about the Python Programming Language Learn about Python IDLE and shell Learn about sudo Python IDLE and shell Learn how to build simple Python calculators
4
Concepts of the Python Programming Language
Python is: An object oriented language An interpretive programming language An easy to learn programming language A rapid prototyping tool for object models and algorithms A creative programming language for creating games and graphics
5
Concepts of the Python Programming Language…
Who created Python? Guido Van Rossum (A Dutch Computer Programming) He created the language in 1986 He worked for Google from Started working for Dropbox in 2013
6
Python Question 1: What type of programming language is Python?
7
Concepts of the Python Programming Language…
Why did Guido Van Rossum created Python? He was looking for a hobby programming language to keep him occupied during the Christmas season. He wanted code that is as understandable as plain English To teach programming in elementary and secondary schools (DARPA proposal: Computer Programming for Everyone
8
Python Question 2: Why did Guido Van Rossum created the Python programming language?
9
Review of Python IDLE and Shell
How to gain access to the Python Shell !
10
Review of Python IDLE and Shell…
The Python Shell allows you to test algorithms and code interactively!
11
Python Question 3 IDLE is the abbreviation for what Python development tool?
12
Review of Python IDLE and Shell…
Help is just 2-clicks away!
13
Review of Python IDLE and Shell…
Online Help: Python Documentation
14
vs What’s different between the two versions? Source:
15
Python Question 4 What shell tool allows access to the Python Documentation?
16
Gaining access to sudo python
17
Gaining access to sudo python…
18
Interpretive Programming Example
19
Interpretive Programming: Let’s Build a Calculator
Lets build a Python Application (Calculator) using interpretive programming to find the voltage drop across a dc motor! Problem: A dc motor’s resistance is equal to 4Ω. The current that flows through the resistor is 500mA. What is the voltage drop across the dc motor? Equation: Vmotor = Rmotor x Imotor
20
Interpretive Programming: Let’s Build a Calculator
Here’s the DC Motor Circuit for the Python Calculator Analysis!
21
Interpretive Programming: Let’s Build a Calculator…
Solution: Rmotor = 4Ω Imotor = 250mA Equation: Vmotor = Imotor x Rmotor Vmotor = 250mA x4Ω Vmotor = 1V
22
Interpretive Programming: Let’s Build a Calculator…
Solution:
23
Interpretive Programming: Let’s Build a Calculator…
The circuit analysis result value is less than the Python Calculator answer because of model component variations!
24
Python Question 5: Why is there a slight difference in Imotor values between the Python calculation and the Microcap circuit model?
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.