3 What’s in a name?Snake logos and mascot notwithstanding, it’s named after Monty Python’s Flying CircusHumor-impaired can safely ignore the spam references :-)Nobody expects the Spanish inquisition
4 What is Python? O-O rapid prototyping language Not just a scripting languageNot just another PerlEasy to learn, read, useExtensible (add new modules)C/C++/Fortran/whateverJava (through Jython)Embeddable in applications
5 Touchy-feely properties Open Source (OSI Certified)copyrighted but use not restrictedno "viral" licenseowned by independent non-profit, PSFMature (13 years old)Supportive user communityplenty of good books, tooSimple design, easy to learnreads like “pseudo-code”Suitable as first languageSuitable as last language :-)
6 High-level properties Extremely portableUnix/Linux, Windows, Mac, PalmOS, WindowsCE, RiscOS, VxWorks, QNX, OS/2, OS/390, AS/400, PlayStation, Sharp Zaurus, BeOS, VMS…Compiles to interpreted byte codecompilation is implicit and automaticMemory management automaticreference counting for most situationsGC added for cycle detection“Safe”: no core dumps due to your bugs
7 What is it used for? rapid prototyping web programming (client and server side)ad hoc programming ("scripting")steering scientific applicationsextension languageXML processingdatabase applicationsGUI applicationseducation
8 Who is using it? Google (various projects) NASA (several projects) NYSE (one of only three languages "on the floor")Industrial Light & Magic (everything)Yahoo! (Yahoo mail & groups)RealNetworks (function and load testing)RedHat (Linux installation tools)LLNL, Fermilab (steering scientific applications)Zope Corporation (content management)ObjectDomain (embedded Jython in UML tool)Alice project at CMU (accessible 3D graphics)More success stories at
9 Language properties Everything is an object Packages, modules, classes, functionsException handlingDynamic typing, polymorphismStatic scopingOperator overloadingIndentation for block structureOtherwise conventional syntax
10 High-level data types Numbers: int, long, float, complex Strings, Unicode: immutableLists and dictionaries: containersOther types for e.g. binary data, regular expressions, introspectionExtension modules can define new “built-in” data types
12 Compared to Perl Easier to learn More readable code very important for infrequent usersMore readable codeMore maintainable codeFewer “magical” side effectsMore “safety” guaranteesBetter Java integration
13 Compared to Java Code up to 5 times shorter Dynamic typing and more readableDynamic typingMultiple inheritance, operator overloadingQuicker developmentno compilation phaseless typingYes, it may run a bit slowerbut development is much fasterand Python uses less memory (studies show)Similar (but more so) for C/C++
14 Jython Seamless integration with Java Separate implementation Implements the same languageDifferent set of standard modulesdifferences in “gray areas”e.g. some different introspection callsdifferent command line options, etc.
15 Jython's Java integration InteractiveCompiles directly to Java bytecodeImport Java classes directlySubclass Java classespass instances back to JavaJava beans integrationCan compile into Java class files
16 Example function def gcd(a, b): "greatest common divisor" while a != 0:a, b = b%a, a # parallel assignmentreturn b
17 Example class class Stack: "A well-known data structure" # doc string def __init__(self): # constructorself.items = def push(self, x):self.items.append(x) # the sky is the limitdef pop(self):x = self.items[-1] # what happens if it’s empty?del self.items[-1]return xdef empty(self):return len(self.items) == 0
18 References and plugs References: - Python home sitedocumentation, downloads, community, PSF- success stories- interview with GvR- Zope community site- Zope corporate sitePython Conferences (seePyCon DC March Washington, DCon-line registration ends today ($200)Python UK April 2-3 Oxford, EnglandEuroPython June Charleroi, BelgiumPython11 at OSCON July 7-11 Portland, OR
Your consent to our cookies if you continue to use this website.