learning python - part 1

Post on 03-Sep-2014

148 Views

Category:

Software

1 Downloads

Preview:

Click to see full reader

DESCRIPTION

Learning python series based on "Beginning Python Using Python 2.6 and P - James Payne" book presented by Koosha Zarei.

TRANSCRIPT

Learning PythonPart 1 | Winter 2014 | Koosha Zarei | QIAU

Part 1

3February 2014Learning Python | Part 1 | Koosha Zarei

ReferencesWhat is Python?Why Python?What can we do with Python?What is the downside?Who use Python?Alternative ImplementationsInstallation and ConfigurationModule, File, and ScriptHow to run programsDebugging Python CodeUseful Links

Content

4February 2014Learning Python | Part 1 | Koosha Zarei

RefereesLearning Python, Fourth Edition, Mark Lutz, 2009, O’Reilly Media, Inc.Beginning Python® Using Python 2.6 and Python 3.1, James Payne, Wiley Publishing, Inc.

Python.org

5February 2014Learning Python | Part 1 | Koosha Zarei

What is Python?Python

Is a General Purpose ,High Level Programming Language.Supports multiple programming paradigms. Features a dynamic type system.Support Automatic memory management.Contains Large and comprehensive standard library.

6February 2014Learning Python | Part 1 | Koosha Zarei

Why Python?Software quality.

Readability, maintainability.

Developer productivity.Less to type, less to debug, and less to maintain.No compile, No Linking step.

Program portability.Cross platform.

Support libraries.

7February 2014Learning Python | Part 1 | Koosha Zarei

Why Python?Component integration.

C, C++, .NET, XML.

Enjoyment.Built-in tool-set.

English keywords.Small core, large standard library, and an easily extensible interpreter.

8February 2014Learning Python | Part 1 | Koosha Zarei

Why Python?High level dynamic data type.Automatic memory management.Free and Open Source.GUI support.

Python is commonly defined as an object-oriented scripting language.

9February 2014Learning Python | Part 1 | Koosha Zarei

What can we do with Python?GUI.Systems Programming.Database Programming.Internet Scripting.Numeric & Scientific Programming.Natural Language Analysis.Rapid Prototyping.Gaming, Images, Serial Ports, XML, Robots, and more.

10February 2014Learning Python | Part 1 | Koosha Zarei

What is the downside?Execution Speed

Execution speed may not always be as fast ascompiled languages such as C and C++.

Source Code Byte Code Interpreter

11February 2014Learning Python | Part 1 | Koosha Zarei

Who use Python?1 million users.Google, YouTube, BitTorrent.Intel, Cisco, Hewlett-Packard, Seagate, Qualcomm, and IBM.Industrial Light & Magic, Pixar.NASA, Los Alamos, Fermilab and JPL.

12February 2014Learning Python | Part 1 | Koosha Zarei

Alternative Implementations

Three Primary ImplementationCpython

Original, Reference and standard.Jython

JavaIronPython

.NET framework

All implement the same Python language but execute programs in different ways

13February 2014Learning Python | Part 1 | Koosha Zarei

Installation and ConfigurationPre-installed on various OS:

Linux: Python 2.Mac OS X: Python 2.Windows: noting!

Download from official website.

'Python -V'Shows version of installed python

Learning Python, Mark Lutz, APPENDIX A

14February 2014Learning Python | Part 1 | Koosha Zarei

Module, File, and ScriptModules:

Text files containing python statements.Ready to execute any number of time and in a variety of ways.Module files are often referred to as programs.Module files that are run directly are also sometimes called scripts.File(s) imported from another file.Packages of additional tools.

15February 2014Learning Python | Part 1 | Koosha Zarei

How to run programsI. The Interactive PromptII.Running Files with Command LinesIII.The IDE User Interface

16February 2014Learning Python | Part 1 | Koosha Zarei

How to run programsThe Interactive Prompt

Simplest wayExperimentingTestingLinux

Just type PythonWindows

Start IDLE’s main windowSelect “Python (command line)”

/usr/local/bin/python/usr/bin/python

C:\Python30\python

17February 2014Learning Python | Part 1 | Koosha Zarei

How to run programs

18February 2014Learning Python | Part 1 | Koosha Zarei

How to run programsRunning Files with Command Lines

Execute python command in terminal by passing the script name.

Run Python Scripts: “python script.py”

Some basic information about command:python -h

19February 2014Learning Python | Part 1 | Koosha Zarei

How to run programsThe IDE User Interface

Integrated Development Environment, Binds together various development tasks into a single view.IDLE

Python program that uses the standard library’s tkinter GUI toolkit to build the IDLE GUI.

Eclipse and PyDev.Komodo.NetBeans IDE for Python.PythonWin.Anjuta.

20February 2014Learning Python | Part 1 | Koosha Zarei

How to run programsThe IDE User Interface

Features:For Authoring, Modifying, Deploying, and Debugging.Interactive debuggerIntegrated compiler/interpreterCode completionProject managementVersion control

Wikipedia | More info about IDE

21February 2014Learning Python | Part 1 | Koosha Zarei

Debugging Python CodeStrategies for debugging Python:

Do Nothing!Python interpret shows very useful error message facing mistakes by default.

PrintFast execution.

IDE DebuggerTrace code in more detail.

pdbAvailable as a module in Python's standard library.

22February 2014Learning Python | Part 1 | Koosha Zarei

Useful Linkspyvideoshowmedo.combestechvideos.comtutorialspoint.com

top related