1 / 16

An Introduction to Python.

An Introduction to Python. By: Anthony Long. What is Python ?. Python is an interpreted, interactive, object-oriented programming language. Installing Python. http :// www.python.org /download/. Definitions. Functions

kisha
Download Presentation

An Introduction to Python.

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. An Introduction to Python. By: Anthony Long

  2. What is Python? • Python is an interpreted, interactive, object-oriented programming language.

  3. Installing Python • http://www.python.org/download/

  4. Definitions • Functions • Functions are reusable code snippets which carry out a specific piece of functionality. • Modules • A collection of objects that can be imported and used by other code • Objects • Any entity that can be manipulated by commands. • Everything in Python is an object. • Classes • Describe the rules by which objects behave

  5. Definitions (con’t) • Boolean • logical data type having one of two values (true or false). • Dictionaries • Dictionaries are data structures that are like lists in that they contain any number of values that you access by the dictionary name and the index. • However, dictionaries offer the added functionality of letting you assign your own key, instead of the integer that lists automatically assign for you. This key is usually a string that you want to associate with the value. • Float • Short for floating point, is a fundamental type used to define numbers with fractional parts • String • A sequence of bytes. • Unicode is the type used for “text” strings. • Integer • A whole number that can be positive, negative or zero • List • An array which can hold arbitrary objects and can expand dynamically as new items are added • None • Value returned for functions without a return statement

  6. Important Modules Pyccuracy Autonose Bpython Ipython Mechanize Mysqldba Pyflakes Selenium pdb

  7. Pyccuracy • Pyccuracy is a Behavior Driven Development style tool written in Python that aims to make it easier to write automated acceptance tests. It improves the readability of those tests by using a structured natural language – and a simple mechanism to extend this language – so that both developers and customers can collaborate and understand what the tests do. • Download: http://pypi.python.org/pypi/Pyccuracy/

  8. Autonose • Autonose is an autotest-like tool for python. • Download: http://pypi.python.org/pypi/autonose/

  9. Bpython • Bpython is a fancy interface to the Python interpreter for Unix-like operating systems. • Download: http://pypi.python.org/pypi/bpython/

  10. Ipython • Ipython is an interactive shell for the Python programming language that offers enhanced introspection, additional shell syntax, code highlighting, tab completion, string completion, and a rich history. • Download: http://pypi.python.org/pypi/ipython

  11. Mechanize • Mechanize is a Python module for stateful programmatic web browsing, used for automating interaction with websites. • Download: http://pypi.python.org/pypi/mechanize/

  12. Mysqldbda • Mysqldbda is an interface for connecting to a MySQL database server from Python. • Download: http://pypi.python.org/pypi/mysqldbda

  13. Pyflakes • Pyflakes is program to analyze Python programs and detect various errors. • Download: http://www.divmod.org/trac/wiki/DivmodPyflakes

  14. Selenium • Selenium is a functional testing framework which automates the browser to perform certain operations which in turn test the underlying actions of your code. • Download here: http://pypi.python.org/pypi/selenium/

  15. pdb • Pdb is an interactive source code debugger for Python programs, supporting breakpoints and single stepping settings at the source level. • More info: http://docs.python.org/library/pdb.html

  16. Now for the fun stuff from selenium import selenium import unittest SERVER_SETUP = [“localhost”, 4444, “*firefox”, “http://google.com/”] class (unittest.TestCase): def setUp(self): self.verificationErrors = [] self.selenium = selenium(*SERVER_SETUP) self.selenium.start() def tearDown(self): self.selenium.stop() def test_(self): """test_""" self.selenium.open("") if __name__ == "__main__": unittest.main()

More Related