Get Lanyrd on your mobile (iPhone, Android and more) - check it out here

Sessions at PyCon US 2012 about Python in H1

Your current filters are…

Clear

Wednesday 7th March 2012

  • Writing a Pyramid application

    by Carlos de la Guardia

    Pyramid is the web framework at the core of the Pylons Project. It's a "pay only for what you eat" framework. You can get started easily and learn new concepts as you go, and only if you need them. It's simple, well tested, well documented, and fast. This course will present Pyramid and lead you through the creation of a an application as the concepts from the framework are introduced.

    Pyramid is the web framework at the core of the Pylons Project. It’s a “pay only for what you eat” framework. You can get started easily and learn new concepts as you go, and only if you need them. It’s simple, well tested, well documented, and fast.

    Though it’s in part inspired by Zope and uses concepts and software that may be familiar to Zope programmers, no prior Zope experience is required to use it. Also, unlike Zope, you don’t need to understand many concepts and technologies fully before you can be truly productive.

    Pyramid is also inspired by Django and Pylons. It tries to learn valuable lessons from things that have gone well with different web frameworks and give the user great flexibility in applying them.

    This course will present Pyramid and lead you through the creation of a an application as the concepts from the framework are introduced. The extensive Pyramid documentation will be used as “text book”.

    Proposed outline:

    • Installation
    • Scaffolds
    • Persistence options
    • URL dispatch
    • Views
    • View configuration
    • Renderers
    • Static views
    • Security
    • Declarative configuration
    • Testing
    • Deployment

    At 9:00am to 12:20pm, Wednesday 7th March

    In H1, Santa Clara Convention Center

    Coverage video

  • How to get the most out of your PyPy

    by Alex Gaynor, Maciej Fijalkowski and Armin Rigo

    For many applications PyPy can provide performance benefits right out of the box. However, little details can push your application to perform much better. In this tutorial we'll give you insights on how to push pypy to it's limites. We'll focus on understanding the performance characteristics of PyPy, and learning the analysis tools in order to maximize your applications performance.

    We aim to teach people how to use performance tools available for PyPy as well as to understand PyPy's performance characteristics. We'll explain how different parts of PyPy interact (JIT, the garbage collector, the virtual machine runtime) and how to measure which part is eating your time. We'll give you a tour with jitviewer which is a crucial tool for understanding how your Python got compiled to assembler and whether it's performing well. We also plan to show potential pitfalls and usage patterns in the Python language that perform better or worse in the case of PyPy.

    We'll also briefly mention how to get your application running on PyPy and how to avoid common pitfalls there, like reference counting or relying on C modules.

    This tutorial is intended for people familiar with Python who have performance problems, no previous experience with PyPy is needed. We ask people to come with their own problems and we'll provide some example ones. Attendees should have the latest version of PyPy preinstalled on their laptops.

    At 1:20pm to 4:40pm, Wednesday 7th March

    In H1, Santa Clara Convention Center

    Coverage video

Thursday 8th March 2012

  • Plotting with matplotlib

    by Mike Müller

    When it comes to plotting with Python many people think about matplotlib. It is widely used and provides a simple interface for creating a wide variety of plots from very simple diagrams to sophisticated animations. This tutorial is a hands-on introduction that teaches the basics of matplotlib. Students will learn how to create publication-ready plots with just a few lines of Python.

    Target Audience

    This tutorial is for Python users who would like to create nice 2d plots with Python.

    Audience Level

    Students should have a working knowledge of Python. NumPy knowledge is helpful but not required.

    Prerequisites

    Please bring your laptop with the operating system of your choice (Linux, Mac OS X, Windows). In addition to Python 2.6 or 2.7, we need: - a current versions of matplotlib (http://matplotlib.sourceforge.net) - IPython (http://ipython.org) and - NumPy (http://numpy.scipy.org).

    Method

    This is a hands-on course. Students are strongly encouraged to work along with the trainer at the interactive prompt. There will be exercises the students need to do on their own. Experience shows that this active involvement is essential for an effective learning.

    Content

    The library matplotlib provides many different types of diagrams from within Python with only few lines of code. Examples are used to exercise the use of this library. The tutorial provides an overview how to create plots with matplotlib. IPython in combination with pylab from matplotlib provides an interactive environment for fast testing of ideas. We will be using this for most of the tutorial.

    With a simple plot we learn how to add axis labels, titles and a legend. The GUI offers zooming, panning, changing of plot sizes and other interactive ways to modify the plot. We will use Python to change properties of existing plots such as line colors, marker symbols, or line styles. There are several ways how to place text on plots. You will learn about the different coordinate systems relative to the plot, the canvas or the figure. Another topic are ticks, where to put them and how to format them to achieve publication-quality plots. The concepts of figures, subplots, and axes and how they relate to each other will be explained with examples.

    matplotlib offers many different types of plots. The tutorial introduces several of them with an example. A more advanced topic will be creating your own plot types. We will build a stacked plot type. Finally, we will create a small animation to explore the possibilities to visualize changes.

    Outline

    • Introduction (5 min)
    • IPython (5 min)
    • pylab (5 min)
    • Simple plots (20 min)
    • Properties (15 min)
    • Text (20 min)
    • Ticks (25 min)
    • Figures, subplots, and axes (25 min)
    • Other types of plots (10 min)
    • The class library (15 min)
    • Creating New Plot Types (20 min)
    • Animations (15 min)

    At 9:00am to 12:20pm, Thursday 8th March

    In H1, Santa Clara Convention Center

    Coverage video

  • Developing custom PyQt widgets and graphical interfaces efficiently.

    by Luis Artola

    Presents techniques and patterns for creating custom PyQt widgets easily. Focus is the separation of layout and logic to produce code that is easy to read and understand, and also inexpensive to maintain and evolve. Encourages and demonstrates the use of layout design applications, code generators and composition over inheritance. Based on PyQt4 but easily applicable to PySide as well.

    Many developers favor the creation of graphical user interfaces by hand-coding the layout of the interface elements. Most often than not, the resulting code is a highly cohesive mix of user interface and business logic that is not easy to maintain. Likewise, the development of custom widgets is often approached by subclassing top-level classes and overriding paint and event-handling methods. While this is the only alterantive for certain types of custom widgets, there is a big percentage that could be more easily created by composition of smaller widgets assembled together to work in as a unit.

    This tutorial aims to share the following with the audience:

    • Make a case for the benefits of using supporting tools for designing the layout portion of graphical user interfaces. In particular, the use of QtDesigner and code generators.
    • Present a pattern and project structure for creating PyQt widgets that can also be used inside QtDesigner.
    • Efficient use of composition over inheritance for assembling elaborate custom widgets more easily.

    All material is based on Python and PyQt4. Audience is expected to have working knowledge of PyQt. Or, at least proficiency developing application in Qt and C++.

    This tutorial is based on PyQt4 but concepts and techniques can be easily transferrable to PySide. Attendees require access to a computer with the following:

    • Qt 4.5.2 or later.
    • PyQt 4.5.4 or later.
    • sip 4.8.2 or later.
    • QtDesigner.
    • Python plugin for QtDesigner.
    • Python 2.5.x, 2.6.x or 2.7.x.

    An easy way to check whether the Python plugin is available or not is to select from QtDesigner's main menu: Help > About Plugins > Loaded Plugins, should show libpythonplugin.so. This is normally installed automatically by the Qt installer.

    At 1:20pm to 4:40pm, Thursday 8th March

    In H1, Santa Clara Convention Center