Presentation is loading. Please wait.

Presentation is loading. Please wait.

Programming 101 with Python: an open-source, cross-platform, and fun language By J. Burton Browning, Ed.D. Copyright © J. Burton Browning All rights reserved.

Similar presentations


Presentation on theme: "Programming 101 with Python: an open-source, cross-platform, and fun language By J. Burton Browning, Ed.D. Copyright © J. Burton Browning All rights reserved."— Presentation transcript:

1 Programming 101 with Python: an open-source, cross-platform, and fun language By J. Burton Browning, Ed.D. Copyright © J. Burton Browning All rights reserved. If you use all or part of this work, please email or contact me with details.

2 Today we will discuss: Overview of my book as course text and history of the language A few basic features with Python Advanced features of Python—not just an introductory language!

3 History Developed by Guido van Rossum 1990 Actively maintained by him and others New features and extensions added all the time Many books and websites with information Name is based on Monty Python and not a large snake!

4 Python features Easy to learn Great for RAD Cross-platform and open-source Compile to *.exe GUI and other add-ins such as Pygame, Vpython, WX Windows, etc. Forces “clean” coding skills Syntax similar to C/C++ and JAVA – can export to C Free and commercial tools available Used everywhere from application development and server scripting to teaching

5 Course: Intro to Programming and Logic History of computers and programming Prototype solutions (flowchart and pseudocode) Program CLI applications Basic control structures Debugging Advanced topics: GUI design, Add-in SDK’s, COM integration, OOP, etc.

6 Two modes of operation Built-in IDE “IDLE” “Line-by-line” or interactive mode “Multi-line” or script mode – can save programs for reuse Helloi.avi

7 Variables and Math operators Variables are automatically “typed” to best fit. No variable declaration. Variables are immutable and not reused. Math operators similar to C++, JAVA, VB, etc. * = multiplication, + = addition, % modulus, etc.

8 Comment statements Pound sign ( # ) is used for single line comments. Multi-line comments are wrapped in triple quoted strings. “”” any comments here… “””

9 Examples

10 Single selection structure and Statement blocks Handled by indentation Forces “clean” code writing Format specifiers similar to C++/JAVA

11 Dual selection structure Similar to other languages Indentation defines statement blocks

12 Multiple selection structure Similar to if, else if, else (could be switch or select case in other languages). elif is same as else if

13 While Similar to loop in other languages

14 For for x in range(10): print x name=“Smith” for letter in name: print letter

15 Functions def function_name(): any code for function…

16 Arrays Very rich collection of “array-like” structures Lists, tuples, and dictionaries More powerful than a standard array Teach same principles Easy to learn and implement

17 Dictionary example

18 Class design Can declare classes in same file or separate file. Can focus on class design without other syntax issues associated with other languages. Put fun into class design!

19 Class example

20 GUI programming Free SDK pythoncard.sourceforge.net Similar to VB/VB.NET Cross-platform unlike Visual Basic! No special “dot net” framework needed! Other GUI SDK’s available as well

21 Pygame Free sdk from www.pygame.org for game/simulation development.www.pygame.org Many good/free tutorials available. Open-source games you can modify.

22 3D Graphics/animation Vpython.org free 3d/animation sdk. Use for general graphics study or physics classes.

23 More information www.python.org www.vpython.org www.pygame.org http://pythoncard.sourceforge.net/ http://www.activestate.com/products/komodo_ide/

24 Questions? Thank you and good luck! Text: Design, Logic, and Programming with Python by James B. Browning www.iuniverse.com www.amazon.com Barnes and Noble


Download ppt "Programming 101 with Python: an open-source, cross-platform, and fun language By J. Burton Browning, Ed.D. Copyright © J. Burton Browning All rights reserved."

Similar presentations


Ads by Google