Beruflich Dokumente
Kultur Dokumente
PYTHON PROGRAMMING
LANGUAGE: A CHEAT SHEET
By James Sanders
With over 8.2 million developers using Python, the popularity of the Python programming language can’t be
denied. Since the first release in1990, Python has gained public support in academia and business, being used
extensively in artificial intelligence and machine learning, serving as the underpinning of OpenStack, as well as
powering the cloud file storage service Dropbox.
This extensibility makes Python an excellent programming language for junior developers to get started with,
but also one that remains applicable at scale, as Python is used extensively for real-world applications. This
cheat sheet explores what Python is used for and how it compares to other programming languages, and
provides resources for learning the language.
Python is dynamically typed and garbage-collected (through reference counting and cycle detection), supports
object-oriented and structured programming fully, and largely supports functional and aspect-oriented
programming, making it particularly versatile and applicable for a wide variety of use cases.
The standard library is commonly considered one of the greatest strengths of Python; this feature enables
programmers to quickly develop projects without needing to rely heavily on third-party packages for the
basic plumbing of a given application. To complement the standard library, the Python Package Index (PyPI)
catalogues over 200,000 packages that provide various functions.
Python is used extensively in artificial intelligence; Google’s TensorFlow framework includes Python modules,
as does Keras and Scikit-learn. The Anaconda project is a distribution of Python and R for scientific
computing. IBM’s Qiskit and D-Wave’s Ocean learning platforms also use Python for programming quantum
computers. Python is used by data scientists, with popular libraries including NumPy, SciPy, and Matplotlib, and
in web development frameworks including Django, CherryPy, Pyramid, Flash, web2py, and webapp2.
2
COPYRIGHT ©2019 CBS INTERACTIVE INC. ALL RIGHTS RESERVED.
PYTHON PROGRAMMING LANGUAGE: A CHEAT SHEET
Graphics editing programs also use inline Python scripting, including the 3D animation software Autodesk 3ds
Max, Maya, and MotionBuilder, as well as Cinema 4D, Lightwave, Houdini, and modo, the Nuke compositor,
and the open source Blender toolset. Of 2D graphics software, PaintShop Pro, as well as the open-source
software GIMP, Inkscape, and Scribus.
Additionally, LibreOffice uses Python for inline scripting, much in the same way Visual Basic is used to extend
features of Microsoft Office.
In 1999, software developer Tim Peters, a major contributor to Python and creator of the original CPython
implementation, wrote the “Zen of Python,” an explanation of Python’s design philosophy, and the philosophy
that programmers should incorporate into their programming approach. The document was later incorporated
into official Python documentation.
3
COPYRIGHT ©2019 CBS INTERACTIVE INC. ALL RIGHTS RESERVED.
PYTHON PROGRAMMING LANGUAGE: A CHEAT SHEET
While the CPython reference implementation is broadly useful for most use cases, other Python interpreters do
exist to address specific needs and deployment scenarios. MicroPython is a microcontroller-focused implemen-
tation supporting Arm architectures, in addition to Arduino, ESP8266, ESP32, and RISC-V (32- and 64-bit)
architectures. CircuitPython is an education-focused fork of MicroPython.
PyPy is the most popular general-purpose alternative implementation of Python. It differs from CPython in
that PyPy is a (faster) just-in-time compiler, while CPython is an interpreter.
Language-target implementations also exist, including CLPython for Common Lisp, IronPython for .NET/
Mono, and Jython for Java. Likewise, the Nuitka project is a source-to-source compiler from Python to C/C++
source code.
Support for Python 2.7 is ending on January 1, 2020, making the transition to Python 3 all the more urgent.
For programmers, tool-assisted porting using futurize or modernize can aid in the transition, while the
caniusepython3 project shows what legacy dependencies may be blocking you from using Python 3.
TechRepublic Academy, a joint venture between TechRepublic, ZDNet, and StackCommerce, also offers a wide
variety of in-depth Python training courses.
4
COPYRIGHT ©2019 CBS INTERACTIVE INC. ALL RIGHTS RESERVED.
PYTHON PROGRAMMING LANGUAGE: A CHEAT SHEET
If you’re already familiar with programming, chances are your IDE of choice either natively supports Python
or support can be added using a plugin. For new programmers, using a free IDE that supports Python is a
quick way to get started—these include Atom, PyCharm, Geany, Sublime Text, and Visual Studio Code.
5
COPYRIGHT ©2019 CBS INTERACTIVE INC. ALL RIGHTS RESERVED.
CREDITS
Editor In Chief ABOUT TECHREPUBLIC
Bill Detwiler
TechRepublic is a digital publication and online community
Editor In Chief, UK that empowers the people of business and technology. It
Steve Ranger
provides analysis, tips, best practices, and case studies
Associate Managing aimed at helping leaders make better decisions about
Editors technology.
Teena Maddox
Mary Weilage DISCLAIMER
Multimedia Producer
Derek Poore
Copyright ©2019 by CBS Interactive Inc. All rights reserved. TechRepublic
Staff Reporter and its logo are trademarks of CBS Interactive Inc. ZDNet and its logo are
Karen Roby trademarks of CBS Interactive Inc. All other product names or services
identified throughout this article are trademarks or registered trademarks of
their respective companies.