A Crash Course in Python, Study notes of Object Oriented Programming

▫ Python and Tkinter Programming by John E. Grayson, Manning, ISBN 1-884777-81-3. Page 4. 4.

Typology: Study notes

2022/2023

Uploaded on 03/01/2023

millyx
millyx 🇺🇸

4.7

(9)

249 documents

1 / 84

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
A Crash Course in Python 1
A Crash Course in Python
Based on
Learning Python
By Mark Lutz & David Ascher, O'Reilly
http://proquestcombo.safaribooksonline.com/book/programming/python/9780596805395
Presented by
Cuauhtémoc Carbajal
ITESM CEM
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16
pf17
pf18
pf19
pf1a
pf1b
pf1c
pf1d
pf1e
pf1f
pf20
pf21
pf22
pf23
pf24
pf25
pf26
pf27
pf28
pf29
pf2a
pf2b
pf2c
pf2d
pf2e
pf2f
pf30
pf31
pf32
pf33
pf34
pf35
pf36
pf37
pf38
pf39
pf3a
pf3b
pf3c
pf3d
pf3e
pf3f
pf40
pf41
pf42
pf43
pf44
pf45
pf46
pf47
pf48
pf49
pf4a
pf4b
pf4c
pf4d
pf4e
pf4f
pf50
pf51
pf52
pf53
pf54

Partial preview of the text

Download A Crash Course in Python and more Study notes Object Oriented Programming in PDF only on Docsity!

A Crash Course in Python^

A Crash Course in PythonBased onLearning PythonBy Mark Lutz & David Ascher, O'Reillyhttp://proquestcombo.safaribooksonline.com/book/programming/python/9780596805395Presented byCuauhtémoc Carbajal^ ITESM CEM

A Crash Course in Python^

Agenda^ „^ Why Python^ „^ Python References^ „^ Python Advantages^ „^ Python Toolkit^ „^ Getting Python^ „^ Running Python^ „^ Python Principles^ „^ Python Language and Examples

Why Python?

It’s Easy to Use

„^ High-level language

: Distinct from the low-level processor operations; closer to human language thanmachine language „ "Programming at the speed of thought" „ Increases productivity^ „^ Python programs three to five times shorter than Java^ „^ Python programs five to ten times shorter than C++ „ Normally, “Programming is like making fine furniture withan axe and a nail file.” „ Python makes it more like working with a table saw & alathe^ „^ You still have to learn how to use them, but they’re theright tools for the job

Python Is Easy to Use(continued)^ „^ Python Program^ print "Game Over!"^ „^ C++ Program^ #include int main(){ std::cout << "Game Over!" << std::endl;return 0;}

7

Python Is Object-Oriented^ „^ Object-oriented programming(OOP):^ Methodology that definesproblems in terms of objects that sendmessages to each other^ „^ In a game, a

Missile^ object could send a Ship object a message to^

Explode

„^ OOP not required, unlike Java and C#

Python Is a “Glue” Language^ „^ Can be integrated with other languages^ „^ C/C++^ „^ Java^ „^ Use existing code^ „^ Leverage strengths of other languages^ „^ Extra speed that C or C++ offers

Python Has a StrongCommunity^ „^ As an approachable language, hasapproachable community^ „^ Python Tutor mailing list^ „^ http://mail.python.org/mailman/listinfo/tutor^ „^ Perfect for beginners^ „^ No actual "tutors" or "students"

Python Is Free and OpenSource^ „^ Open source

: Publicly available; open

source software typically programmedby volunteers; anyone can use sourcecode without fee „ Can modify or even resell Python „ Embracing open-source ideals is part ofwhat makes Python successful

A Crash Course in Python^

Fastest Way to Learn^ „^ Study examples^ „^ Lay foundations without surprises^ „^ Note the exceptions to experience^ „^ Do quick pop quizzes^ „^ Practice what you have learned

A Crash Course in Python^

Python Advantages^ „^ Object-Oriented^ „^ Dynamic Type Checking makes it inherentlygeneric – C++ templates for free!^ „^ Free, as in Open Source free^ „^ Portable^ „^ Powerful language constructs / features^ „^ Powerful toolkit / library^ „^ Mixable with other languages^ „^ Easy to use & learn

How Python Is Used^ „^ System utilities^ „^ GUIs using Tkinter^ „^ Component integration^ „^ Rapid prototyping^ „^ Internet scripting^ „^ Database programming

Getting Python^ „^ On the Web:^ www.python.org

Running Python (2)^ „^ From platform specific shells^ „^ #!/usr/local/bin/python^ „^ print "Hello there"^ Or^ „^ #!/usr/bin/env python^ „^ print "Hello there"

Python defined as anenvironment variable

Running Python (3)^ „^ Embedded in another system^ „^ #include <Python.h>^ „^ //...^ „^ Py_Initialize();^ „^ PyRun_SimpleString("x=pfx+root+sfx");^ „^ //...^ „^ Platform-specific invocation^ „^ E.g., Double clicking

.py^ files