ch 1. a python q&a session spring 2009. why do people use python? software quality developer...
TRANSCRIPT
Ch 1. A Python Q&A Session
Spring 2009
Why do people use Python?
Software quality Developer productivity Program portability Support libraries Component integration
Why do people use Python?
Software quality Python is designed to be readable, and hence
reusable and maintainable The uniformity of Python code makes it easy to
understand, even if you didn’t write it Python is deep support for software reuse
mechanisms such as object-oriented programming (OOP)
Why do people use Python?
Developer productivity Python code is typically 1/3 to 1/5 the size of equivalent
C++ or JAVA code Less to type, less to debug, and less to maintain Python programs run immediately, without compile and
link steps of some other tools, further boosting programmer speed
Why do people use Python?
Program portability Most python programs run unchanged on all major
computer platforms Porting Python code between Linux and Windows, we just
need copy a script’s code between machines Offer multiple options for coding portable graphical user
interfaces, database access programs, web-based systems Even for operating system interfaces, are possibly portable
in Python
Why do people use Python?
Support libraries A large collection of prebuilt and portable functionality,
known as stand library Be extended with homegrown libraries and third-party
application support software Third-party domains offer tools for website construction,
numeric programming, serial port access, and game development
For example, NumPy, an extension almost equivalent to Matlab numeric programming system
Why do people use Python?
Component integration Python scripts can communicate with other parts of an
application by integration mechanisms Today, Python code can invoke C and C++ libraries, can
be called from C and C++, can integrate with Java components
Communicate over such as frameworks COM, .NET Interact over networks with interfaces like SOAP, XML,
CORBA
What can I do with Python?
System programming Built-in interfaces to operating system services make it
ideal to write system administration tools and utilities Python programs can search files and directory trees,
launch other programs, do parallel processing
GUIs A standard object-oriented interface to the Tk GUI API,
Tkinter, allowing Python programs to implement portable GUIs
Other toolkits also can be used in Python
What can I do with Python?
Internet scripting Come with standard internet modules to allow Python to
perform networking tasks A large collection of third-party tools available on the web
for doing Internet programming in Python
Database programming Interfaces to all commonly used relational databases
systems such as Sybase, Oracle, etc
Games, images, AI, XML and more
What are Python’s Technical Strength
It’s OOIt’s freeIt’s PortableIt’s PowerfulIt’s Easy to useIt’s Easy to learn
What is the Downside of Python?
Perhaps the only downside to Python is that the execution speed may not always as fast as compiled languages such as C and C++
Python is not compiled all the way down to binary machine code, it compiled to byte code instead
Who Uses Python Today? 2007, roughly 1 million users of Python around the world Google and Yahoo currently use Python in Internet service The YouTube video sharing service is largely writing in Python IBM use Python for hardware testing BitTorrent peer-to-peer file sharing system is a Python program Industrial Light and Magic use Python in the production of
movie animation JPMorgan chase apply Python for financial market forcasting NASA uses Python for scientific programming tasks For more details, visit www.python.org
Install Python
Links of Python download Windows installer Mac installer Python tutorial
Install Python
1. Click the installer
Install Python
2. Click Next
Install Python
3. Click Next
Install Python
4. Choose the installation path, click Next
Install Python
5. Click Install
Install Python
6. Click Finish, then we can open Python in Pythonwin IDE or interactive shell modes
How do you run programs?
Three different methods Interactive Coding Files (such as NotePad, WordPad) Integrated Development Environment (IDE)
Hello World Program
Python program
“Hello World” in C
C programmain()
{
printf("hello, World!\n");
}
“Hello World” in Java
Java programclass helloworld
{
public static void main(String args[])
{
System.out.println("Hello World!");
}
}
Some more Python codes
6+9
print 6+9
print “6+9”
a=6+9
print a
a=6
b=9
a+b
Some more Python codes