Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
16 views

1 Introduction To Python

The document discusses Python including its popularity, uses, installation, how it runs programs, and how to run programs. Python is an interpreted, object-oriented programming language developed by Guido van Rossum. It is popular due to developer productivity, portability, support libraries, and component integration. The document covers installing Python, how the Python interpreter runs programs by compiling code to bytecode, and different ways to run programs such as via the interactive prompt or by writing code in files.
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
16 views

1 Introduction To Python

The document discusses Python including its popularity, uses, installation, how it runs programs, and how to run programs. Python is an interpreted, object-oriented programming language developed by Guido van Rossum. It is popular due to developer productivity, portability, support libraries, and component integration. The document covers installing Python, how the Python interpreter runs programs by compiling code to bytecode, and different ways to run programs such as via the interactive prompt or by writing code in files.
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 7

Agenda

• The Python Conceptual Hierarchy


• installation and environment setup
• How Python Runs programs
• How you Run programs
What is Python and Why so popular??
• Python is an interpreted, object-oriented, high-level programming language.
• Developed by Guido van Rossum, implementation began by 1989.
Why So popular:
• Developer productivity
• Program portability
• Support libraries
• Component Integration
Downsides:
• Speed of execution is less compared to fully compiled programming languages such as c/c++
Major users of Python:
• Google makes extensive use of Python in its web search systems.
• Intel, Cisco, Hewlett-Packard, Seagate, Qualcomm, and IBM use Python for hardware testing.
• NASA use Python for scientific programming tasks.
• iRobot uses Python to develop commercial and military robotic devices.
Installation and environment setup
• Install python for windows platform

• Link to download the setup:


https://www.python.org/downloads/release/python-392/

• Setup system environment variables( PATH variable)


How Python Runs programs?
Python Interpreter:
• An interpreter is a kind of program that executes other programs.
• the interpreter is a layer of software logic between your code and the computer hardware on your machine.
• When you write a Python program, the Python interpreter reads your program and carries out the instructions it contains.
Byte code compilation:
• when you execute a program Python first compiles your source code (the statements in your file) into a format known as
byte code
• Compilation is simply a translation step, and byte code is a lower-level, platform-independent representation of your
source code.

• The PVM is the runtime engine of Python; it’s always present as part of the Python system, and it’s the component
that truly runs your scripts. (“Python interpreter.” )
Python Implementation Alternatives:
• CPython (standard implementation)
• Jython
• IronPython
• Stackless
• PyPy

How You Run Programs?


• Via. Interactive prompt ( open cmd >> python) {note: you have not set your system’s PATH environment variable to
include Python’s install directory}
• The interactive prompt runs code and echoes results as you go, but it doesn’t save your code in a file.
• you won’t do the bulk of your coding in interactive sessions, the interactive prompt turns out to be a great place to both
experiment with the language and test program files on the fly.
• To save programs permanently, you need to write your code in files, which are usually known as modules.
• Modules are simply text files containing Python statements
• Once they are coded, you can ask the Python interpreter to execute the statements in such a file any number of times,
and in a variety of ways (command lines, by file icon clicks, by options in the IDLE user interface etc..)
• files of code you want to import into a client have to end with a .py suffix.
• Technically, IDLE is a Python program that uses the standard library’s tkinter GUI
• Other popular IDE’s – Pycharm, Spyder

You might also like