background preloader

Python 2.6 Quick Reference

Python 2.6 Quick Reference
Style chooser: Modern, Modern B&W, Modern Colored, Classic, High contrast or Printing [Hint: Use styles Modern B&W or Printing to print. If you get problems, try printing the PDF versions instead] Contents Front matter Version 2.6 (What's new?) Creative Commons License. Last updated on July 31, 2010. Feb 10, 2009 upgraded by Richard Gruet and Josh Stone for Python 2.6 Dec 14, 2006 upgraded by Richard Gruet for Python 2.5 Feb 17, 2005, upgraded by Richard Gruet for Python 2.4 Oct 3, 2003 upgraded by Richard Gruet for Python 2.3 May 11, 2003, rev 4 upgraded by Richard Gruet for Python 2.2 (restyled by Andrei) Aug 7, 2001 upgraded by Simon Brunning for Python 2.1 May 16, 2001 upgraded by Richard Gruet and Simon Brunning for Python 2.0 Jun 18, 2000 upgraded by Richard Gruet for Python 1.5.2 Oct 20, 1995 created by Chris Hoffmann for Python 1.3 Color coding: Features added in 2.6 since 2.5 Features added in 2.5 since 2.4 Features added in 2.4 since 2.3 A link Invocation Options python[w] [-BdEhimOQsStuUvVWxX3?] Related:  python

Learning Python Design Patterns Through Video Lectures In my previous post about learning Python programming through video lectures I stopped at three lectures on Design Patterns. This time I continue from there. If you don't know what a Design Pattern is, think of it as a simple solution to a specific problem that occurs very frequently in software design. For example, suppose you use a bunch of unrelated pieces of code. It is a nice idea to bring the unrelated pieces of code together in a unified interface. This design pattern is called Facade. The three lectures are given by Alex Martelli who works as "Über Tech Lead" for Google. Python Design Patterns, Part I Alex briefly covers the history and main principles of Design Patterns and quickly moves to discussing Structural and Behavioral DPs in Python. Interesting ideas from the lecture: Python Design Patterns, Part II In this lecture Alex discusses behavioral patterns. Python Design Patterns, A Recap This video lecture was presented at Google Developers day.

About Python · A Byte of Python Story behind the name Features of Python Simple Easy to Learn Free and Open Source High-level Language Portable Interpreted Object Oriented Extensible Embeddable Extensive Libraries Summary Python 3 versus 2 What Programmers Say Eric S. BeginnersGuide/NonProgrammers Python for Non-Programmers If you've never programmed before, the tutorials on this page are recommended for you; they don't assume that you have previous experience. If you have programming experience, also check out the BeginnersGuide/Programmers page. Books Each of these books can be purchased online and is also available as a completely free website. Automate the Boring Stuff with Python - Practical Programming for Total Beginners by Al Sweigart is "written for office workers, students, administrators, and anyone who uses a computer to learn how to code small, practical programs to automate tasks on their computer." Interactive Courses These sites give you instant feedback on programming problems that you can solve in your browser. CheckiO is a gamified website containing programming tasks that can be solved in Python 3. Resources for Younger Learners Build a "Pypet" Learn programming fundamentals in Python while building a tamagotchi style "Pypet" by Tatiana Tylosky. Videos Tools

Syllabus | Introduction to Computer Science and Programming (the eff-bot guide to) The Standard Python Library Overviews (15) Core Modules [core-modules-index]Data Representation [data-representation-index]Data Storage [data-storage-index]File Formats [file-formats-index]Implementation Support Modules [implementation-support-modules-index]Internationalization [internationalization-index]Mail and News Message Processing [mail-and-news-message-processing-index]More Standard Modules [more-standard-modules-index]Multimedia Modules [multimedia-modules-index]Network Protocols [network-protocols-index]Other Modules [other-modules-index]Platform Specific Modules [platform-specific-modules-index]Preface [preface-index]Threads and Processes [threads-and-processes-index]Tools and Utilities [tools-and-utilities-index] Articles (249) The aifc module [aifc]The anydbm module [anydbm]The array module [array]The asynchat module [asynchat]The asyncore module [asyncore]The atexit module [atexit]The audiodev module [audiodev] The keyword module [keyword]The knee module [knee]

s Python Class  |  Python Education  |  Google Developers Welcome to Google's Python Class -- this is a free class for people with a little bit of programming experience who want to learn Python. The class includes written materials, lecture videos, and lots of code exercises to practice Python coding. These materials are used within Google to introduce Python to people who have just a little programming experience. The first exercises work on basic Python concepts like strings and lists, building up to the later exercises which are full programs dealing with text files, processes, and http connections. To get started, the Python sections are linked at the left -- Python Set Up to get Python installed on your machine, Python Introduction for an introduction to the language, and then Python Strings starts the coding material, leading to the first exercise. This material was created by Nick Parlante working in the engEDU group at Google. Tip: Check out the Python Google Code University Forum to ask and answer questions.

Improve Your Python: Python Classes and Object Oriented Programming The class is a fundamental building block in Python. It is the underpinning for not only many popular programs and libraries, but the Python standard library as well. Understanding what classes are, when to use them, and how they can be useful is essential, and the goal of this article. In the process, we'll explore what the term Object-Oriented Programming means and how it ties together with Python classes. Everything Is An Object... What is the class keyword used for, exactly? What do we mean by "logical grouping"? Regardless, classes are a modeling technique; a way of thinking about programs. ..So Everything Has A Class? Classes can be thought of as blueprints for creating objects. class Customer(object): """A customer of ABC Bank with a checking account. The class Customer(object) line does not create a new customer. The jeff object, known as an instance, is the realized version of the Customerclass. self? So what's with that self parameter to all of the Customer methods? __init__ Wow.

AI Materials Python Basics Required Files You can download all of the files associated with the Python mini-tutorial as a zip archive: If you did the unix tutorial in the previous tab, you've already downloaded and unzipped this file. Table of Contents The programming assignments in this course will be written in Python, an interpreted, object-oriented language that shares some features with both Java and Scheme. We encourage you to type all python shown in the tutorial onto your own machine. You may find the Troubleshooting section helpful if you run into problems. Invoking the Interpreter Python can be run in one of two modes. You invoke the interpreter by entering python at the Unix command prompt. [cs188-ta@nova ~]$ python Python 2.6.5 (r265:79063, Jan 14 2011, 14:20:15) [GCC 4.4.1] on sunos5 Type "help", "copyright", "credits" or "license" for more information Operators The Python interpreter can be used to evaluate expressions, for example simple arithmetic expressions. Lists

Overview The Notebook is the place for all your needs Data Ingestion Data Discovery Data Analytics Data Visualization & Collaboration Multiple language backend Zeppelin interpreter concept allows any language/data-processing-backend to be plugged into Zeppelin. Currently Zeppelin supports many interpreters such as Scala(with Apache Spark), Python(with Apache Spark), SparkSQL, Hive, Markdown and Shell. Adding new language-backend is really simple. Apache Spark integration Zeppelin provides built-in Apache Spark integration. Zeppelin's Spark integration provides Automatic SparkContext and SQLContext injectionRuntime jar dependency loading from local filesystem or maven repository. Data visualization Some basic charts are already included in Zeppelin. Pivot chart With simple drag and drop Zeppelin aggeregates the values and display them in pivot chart. Learn more about Zeppelin's Display system. ( text, html, table, angular ) Dynamic forms Learn more about Dynamic Forms. Collaboration Publish

District Data Labs - How to Develop Quality Python Code How to Develop Quality Python Code Workflows and Development Tools Benjamin Bengfort Developing in Python is very different from developing in other languages. Python sits in the middle of these paradigms, providing the best of many worlds. However, the breadth of Python means that there is no one workflow to developing with it, and certainly there is no standard IDE or environment framework to make these decisions on your behalf. A Development Environment So what do you need in order to successfully develop data apps with Python? A text editor - Sublime, Notepad++, Vim, Emacs, and Text Wrangler all work.A terminal with the python executable in your path. That's it! IDLE - this environment will be familiar to Windows users who probably executed their first Python commands in it. However, even when using one of these tools, you'll still probably use the basic workflow described below. As your projects grow larger you will also want to include the following tools into your worklow: Conclusion

My virtualenv and virtualenv wrapper cheat sheet. I alias the commands of virtualenv and virtualenv wrapper for my own development environment. Ben's VirtualEnv Cheatsheet This cheat sheet describes my usage/implementation of virtualenv with virtualenv wrapper and the bash foo that I added with the help of many blogs to make it all tick together in fun land. Quick Reference $ echo $WORKON_HOME /Users/benjamin/.virtualenvs $ echo $PROJECT_HOME /Users/benjamin/Repos/git/ Commands All of the commands below are to be used on the Terminal Command line. venv List or change working virutal environments (alias workon) venv [environment_name] venv.exit Switch from the virtual environment back to system Python (alias deactivate) venv.exit List all of the environments (alias lsvirtualenv) [-b] [-l] [-h] -b Brief mode, disables verbose output -l Long mode, verbose output, default -h Print help Show the details for a single virtualenv [env] venv.init Create a new environment in the WORKON_HOME (alias mkvirtualenv) venv.init ENVNAME venv.init [-a project_path] [-i package] [-r requirements.txt] [virtualenv opts] ENVNAME