Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

01-1 Introduction To Python

Download as pdf or txt
Download as pdf or txt
You are on page 1of 17

Introduction to Python

Licheng QU
School of Information Engineering
University of Changan
Content
• What is Python?
• Why Do People Use Python?
• Is Python a “Scripting Language”?
• What’s the Downside?
• Who Uses Python Today?
• What Can I Do with Python?
• What Are Python’s Technical Strengths?
• Philosophy of Python
What is Python?
• Python is an easy to learn, powerful programming language. It has
efficient high-level data structures and a simple but effective
approach to object-oriented programming.
• Python's elegant syntax and dynamic typing, together with its
interpreted nature, make it an ideal language for scripting and rapid
application development in many areas on most platforms.
• Python is an interpreted high-level programming language for
general-purpose programming.
Why Do People Use Python?
• Software quality
Python code is designed to be readable, and hence reusable and
maintainable—much more so than traditional scripting languages.

• Developer productivity
Python boosts developer productivity many times beyond compiled or
statically typed languages. Python code is typically one-third to one-
fifth the size of equivalent C++ or Java code.
less to type, less to debug and less to maintain.
Why Do People Use Python?
• Program portability
Most Python programs run unchanged on all major computer platforms.
Porting Python code between Linux and Windows is usually just a
matter of copying a script's code between machines.
• Support libraries
Python comes with a large collection of prebuilt and portable
functionality, known as the standard library.
Python's third-party domain offers tools for website construction,
numeric programming, serial port access, game development, and
much more.
Why Do People Use Python?
• Component integration
Python scripts can easily communicate with other parts of an
application, using a variety of integration mechanisms.
C and C++ libraries, Java and .NET components, COM, SOAP, XML-RPC,
CORBA etc.

• Enjoyment
Because of Python's ease of use and built-in toolset, it can make the act
of programming more pleasure than chore.
Is Python a “Scripting Language”?
• Python is a general-purpose programming language that is often
applied in scripting roles.
• Python is commonly defined as an object-oriented scripting
language—a definition that blends support for OOP with an overall
orientation toward scripting roles.
• Someone labeled Python as Shell tools or Control language. But
Python is not just a better shell-script language or a control language.
• In general, the term ”scripting” is probably best used to describe the
rapid and flexible mode of development that Python supports, rather
than a particular application domain.
What’s the Downside?
• Its execution speed may not always be as fast as that of compiled
languages such as C and C++.
• The standard implementations of Python today compile (i.e., translate)
source code statements to an intermediate format known as byte
code and then interpret the byte code.
• Because Python is not compiled all the way down to binary machine
code (e.g., instructions for an Intel chip), some programs will run
more slowly in Python than in a fully compiled language like C.
• Python has been optimized numerous times, and Python code runs
fast enough by itself in most application domains.
Who Uses Python Today?
TIOBE Index for February 2019
TIOBE Index for February 2020
Very Long Term History
Who Uses Python Today?
• there are roughly 1 million Python users around the world today
• Python is automatically included with Linux distributions, Macintosh
computers, and some products and hardware, further clouding the
user-base picture.
• Python is also being applied in real revenue-generating products by
real companies.
ü Google makes extensive use of Python in its web search systems, and
employs Python's creator.
ü The YouTube video sharing service is largely written in Python.
ü The popular BitTorrent peer-to-peer file sharing system is a Python program.
ü ... ...
What Can I Do with Python?
• In addition to being a well-designed programming language, Python is
useful for accomplishing real-world tasks—the sorts of things
developers do day in and day out.
• It's commonly used in a variety of domains, as a tool for scripting
other components and implementing standalone programs.
• In fact, as a general-purpose language, Python's roles are virtually
unlimited: you can use it for everything.
• Systems Programming, GUIs, Internet Scripting, Component
Integration, Database Programming, Rapid Prototyping, Numeric and
Scientific Programming, Gaming, Images, Serial Ports, XML, Robots,
and More.
What Are Python's Technical Strengths?
• Object-Oriented
• Dynamic typing
• Automatic memory management
• Free
• Portable
• Powerful
• Mixable
• Easy to Use
• Easy to Learn
Philosophy of Python
• Beautiful is better than ugly
• Explicit is better than implicit
• Simple is better than complex
• Complex is better than complicated
• Readability counts

• Python's philosophy rejects the Perl "there is more than one way to
do it" approach to language design in favor of "there should be one—
and preferably only one—obvious way to do it".
Discussion & Homework

Why do you want to learn Python?

Why does Python run slower than C?

You might also like