1 / 15

Python

Python. Jordan Miller and Lauren Winkleman CS 311 Fall 2011. Guido Van Rossum implemented/created Python in 1991. He wanted to create a language anyone can use. The point was to make it an easy language to learn. Rossum is known as Python’s Principal Author

raimundo
Télécharger la présentation

Python

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Python Jordan Miller and Lauren WinklemanCS 311Fall 2011

  2. Guido Van Rossum implemented/created Python in 1991. He wanted to create a language anyone can use. The point was to make it an easy language to learn. • Rossum is known as Python’s Principal Author • Python was awarded the TIOBE Programming Language of the Year twice (2007, 2010) Background

  3. ‘Pythonistas’ (advocates of Python) believe that Python is better than C or C++ and should be used for all programming work, not just scripting • Uses dynamic typing with the feature of “late binding” • Uses reference counting and a cycle detecting garbage collector • Can be used as an extension language for existing modules and applications that need a programmable interface • Used on windows macintosh and unix platforms About Python

  4. Often used as a scripting language for web applications although this was not its original purpose • Has been used in Artificial Intelligence (AI) • Can be used for CGI • Python was implemented in C • Implementations can compile not only byte codes but can turn Python code into machine code Domain and Implementation

  5. Python’s Philosophy: “There should be one and preferably only one way to do it.” • Clean and clutter free syntax and in plain English • Multi-paradigm programming language so programmers can use different programming styles when writing (functional, object-oriented, imperative) • There are no semicolons at the end of Python source code statements. A new line means a new statement. If you need a very long line, you can use the backslash character for continuation, e.g. x = y + \z Evaluation: Writability

  6. Python’s Goal: “To reduce confusion by having a syntax that is understandable in plain English” • Includes basic text manipulation facilities of Awk and Perl, making it easier to read • Fewer syntax rules • Similar format for if/for/while statements as other programs • A+ for readability. This is considered one of its greatest advantages. Evaluation: Readability

  7. Python is implemented in C and relies on well understood, portable C libraries • Python.org states that in applications that started out as pure C++ with Python being added as an extension language, a higher % of code written in Python = an increase in overall performance, functionality and reliability of the application. • Creates robust applications Evaluation: Reliability

  8. Cost of interactivity is high but it speeds up the execution time • Because it is so easy to learn and write, the cost is lower in the training and development stages and interactive mode makes testing fast and easy. “When in doubt, try it out!” Evaluation:Cost

  9. Easy to learn, even non experienced programmers can use it. Ex: spacing and tabbing instead of extra syntax (Don’t have to learn new rules) • Can be used extensively to benefit other programming languages • Interactive mode • Development process proceeds 5 to 10 times faster than in other languages such as Java or C++ • Less memory used because a single container hold multiple data types and each type doesn’t require its own function Advantages

  10. Python interprets the code during runtime instead of compile time causing a slower execution. Runs 1 to 5 times slower than Java or C++ • Official documentation is scarce because the language evolves so often. • New modules are not always a part of the standard release or standard library and must be imported into the project. Disadvantages

  11. Interactive mode allows Python to function as a quick calculator. Ex:What is 5% above 88.88?% python>>> 1.05*88.8893.323999999999998 Fun Fact

  12. If statement: if x < 3:print “hello” • For statement: for i in range(10): print i • While statement: while x < 8: x = x + 1 Syntax Statements

  13. name = raw_input(‘Please enter your \ name:’) course = raw_input(‘Enter the course \ number:’) num = int(course) if num == 311: print name, “ is in this class.” else: print name, “ is not in this class.” Program Example

  14. Google • Gaming industries • Battlefield 2 – score keeping and team balancing • Star Trek Bridge Commander – mission scripting and many other features • Yahoo Maps • Linux Weekly News Who’s Using Python?

  15. A Quick, Painless Tutorial on the Python Language by Norman Matloff • python.org and wiki.python.org • ugweb.cs.ualberta.ca Sources

More Related