Your current filters are…
Worried about the future of Python 3? Wondering when lambda will be fixed? Angry about the GIL? Eager to get your package into the standard library? In this keynote, Python’s BDFL will address these issues and many others from his unique, personal perspective. Learn how not to be a troll!
by Alex Martelli
Grace Murray Hopper’s famous motto, “It’s easier to ask forgiveness than permission”, has many useful applications – in Python, in concurrency, in networking, as well of course as in real life. However, it’s not universally valid. This talk explores both useful and damaging applications of this principle.
I start by introducing the motto “It’s easier to ask forgiveness than permission” and the woman who used it, Rear Admiral Grace Murray Hopper, also known as the “mother of Cobol” and the author of the first ever programming-language compiler.
I then move on to the Python context, where the motto supports the proper usage of exception-catching rather than preliminary checks; and the “rule that proves the exception” introduced by abstract base classes.
Expanding the subject, I show how “optimistic concurrency” applies that motto (while locking would “ask permission”, in essence, STM “asks forgiveness"), and how collision-detection focused networking protocols have similarly triumphed over more highly structured, “ask permission” ones like token-ring.
Moving to the fuzzier context of real life, I then show how this daring approach does not work quite as well as in the technical realm – except when applied correctly, in the right circumstances… and I try to evince a general law describing what the right circumstances for its application are, comparing and contrasting with the similar issue of “do it right the first time” versus “launch and iterate” (and the latter’s cognate “fail, but fail fast” principle).
An open session where the BDFL will answer questions from attendees.
Questions must be submitted (and voted) through Google Moderator; we will ask the most popular questions to Guido during this session.
A complex network is a network that has non trivial topological properties, i.e., properties hinting the presence of elaborate relationships among the actors, opposed to simple networks such as regular lattices or random graphs. Examples of complex networks are most social, technological or biological networks, such as the internet, the web, a professional network, the nervous system of an animal or the contact network of any social networking system.
Network analysis has many practical applications, e.g., ranking or grouping items on the basis of their position in the network, and is also the basis of some collective intelligence and data mining techniques. Recently network analysis is also applied to security problems in the form of trust networks.
Along with the basic concepts, working Python code is presented, both using existing network analysis Python tools and numeric packages. The focus is mainly placed on code, which will be shown and discussed together with the theory, with the idea that running code and simulations are easier to understand that formal maths. Since complex network datasets are typically huge, some high-level optimization techniques are also discussed.
Although formulas are kept at the minimum, some maths skills are required along with basic knowledge of the Python programming language.
by Thomas Perl
The goal of this training is to show you how to start developing full Android applications using only Python. Different technologies will be demonstrated, including PySide-based QML GUIs using the Necessitas Qt port and the Py4A/SL4A-based approach, which can be combined with Android’s WebKit and re-use Python web frameworks.
While Android already has a good SDK out of the box, being able to use Python instead of Java is a big advantage for some developers - it allows for quicker turnaround times, and reuse of Python libraries. Python on Android uses a native CPython build, so its performance and compatibility is very good. Combined with PySide (which uses a native Qt build) and Qt’s support for OpenGL ES acceleration, you can create fluent UIs even with Python.
The resulting PySide-based applications run on Android, but also at least on Mac OS X, Windows, Linux and Maemo and MeeGo - basically all platforms on which Qt is available. The SL4A/Py4A-based applications will run on Android only, but will be able to utilize Android-specific APIs. Both approaches can also be combined.
Nel corso dell’ultimo anno abbiamo lavorato all’implementazione Python di una RESTful Web API completa. Abbiamo imparato un bel po’ di cose sui best pattern REST e, naturalmente, abbiamo messo alla prova le ben note capacità web di Python, rilasciando nel frattempo un paio di progetti Open Source. Nel corso del mio intervento condividerò quel che abbiamo imparato. Prenderemo in considerazione il problematico design di una REST API ‘pura’. Vedremo che cosa offre Python in questo campo e scenderemo infine nel dettaglio, dando una occhiata al codice che abbiamo scritto. Alcune tecnologie/stack che tratteremo sono (in nessun ordine particolare): Flask, PyMongo, MongoDB, REST, JSON, XML, Heroku. Lo sapevi? Che ti piaccia o no, c’è una REST API nel tuo futuro.
Python has great support for interfacing with C/C++ code, and this has been used to great advantage by exposing many C/C++ libraries as Python modules. In this talk, I will reverse the equation. I will show you how you can - and why you might want to - build C++ APIs on top of Python modules and use them directly from your C++ programs.
The topics will include:
I will also discuss the reasons why C++ APIs on Python code represent a very useful and often powerful technique. The reasons range from simple pragmatism (you want to use an existing Python module in an existing C++ program) to productivity (writing Python code plus a C++ wrapper can be easier and faster than writing pure C++.)
by Davide Corio
OpenERP 6.1 è uno dei più importanti free e opensource software scritti in Python. Immergiamoci nel framework a scopriamo come progettare la nostra applicazione.
Durante la presentazione exploreremo gli strumenti integrati a disposizione degli sviluppatori per la creazione di nuove funzionalità, la progettazione di stampe o per dialogare con dispositivi mobile e applicazioni di terze parti.
The talk targets developers who wish to publish applications to an international audience and will discuss three topics that developers have to deal with: handling Unicode, localizing the software with gettext and handling time zones.
First, the talk will address what Unicode is and how to write applications that deal with Unicode correctly. Then, the talk will discuss software localization using gettext and will conclude with a discussion of time zone handling in Python.
No prerequisites are necessary.
The Python Standard Library contains all kinds of useful stuff - healthy, wholesome stuff like a wide array of support libraries for file formats, a web server, easy access to OS services and functional programming tools.
Among those benevolent libraries hide other, darker libraries. They offer tremendous power to anyone who learns how to wield them, but they also carry the threat of destroying your software’s readability, comprehension and very structure.
This session will be a hands-on-keyboard dive into the dark magic parts of the standard library, and participants will learn valid (for a given value of valid) use-cases for practices that will give any software engineering professor nightmares. It focuses on learning by doing, and (evil?) koans are used to teach some of the most ‘clever’ tricks of standard Python.
by Péter Szabó
The earlier a bug is discovered, the cheaper it is to fix it. Method restrictions (such as abstract, final and @Override) help the programmer in discovering incompatibilities between a class and its subclass early (i.e. at startup time for Python and at compile time for compiled languages). Python doesn’t provide method restrictions out of the box. To implement them, we take a deep dive to the realms of Python metaprogramming (decorators, metaclasses, method wrappers, traceback inspection and builtins). Lots of short and code examples will be provided to show the building blocks and how we combine them.
In one intensive four-hour tutorial, we will cover everything that a Python developer needs to know to set up, maintain, and get best performance out of a PostgreSQL database:
The focus is the skills needed by developers in a devops environment who need to step into the database administrator role. No previous database administration experience is assumed.
by Antonio Cuni
Python is a powerful language. Beginners appreciate its surface of simplicity and ease to use, where (almost) everything “just works” (TM) as expected. However, under the hood, there is a whole world of rules and layers which can be (ab)used by experienced programmers to tweak the language in unexpected ways.
Often, these techniques are labeled as “hacks” or “black magic”, to indicate that they should not used in production or that you should not look at it unless you are “initiated” to some not better specified sorcery.
However, if used with care and in the right places, these techniques can lead to better, faster and/or more readable code, or can be extremely useful during debugging, and thus deserve the definition of “white magic” which programmers can use to improve their code. Moreover, looking at how they are implemented is a good way to learn about some of the deep corners of the language.
This talk presents some of these advanced techniques which I have seen in use in real code, e.g. in PyPy or pdb++. Including, but not limited to: creating new functions by reusing existing code objects, instantiating multiple copies of the same module, playing with metaclasses in various ways, changing the __class__ of an object on the fly to get specialized behavior, automatically entering the debugger when a certain event occur, etc.
by Arnaud Fontaine
Recent cloud architecture are heavily based on key-value storage databases rather than distributed filesystems. While the data itself is usually stored in scalable database, the source code is mainly kept on the filesystem. However, having the source code on filesystem raises a lot of issues for cloud applications and more generally for transactional web applications supposed to be deployed on a large number of servers:
Everytime the source code is modified, it has to be synchronized on all the nodes somehow and the application server must be restarted, therefore implying downtime or inconsistency.
Usually, the developer cannot directly modify the source code as this task is left to the administrator.
This talk will show how source code, including modules and their classes, can be migrated away from filesystem, thanks to import hooks, meta classes, reflection and metaprogramming provided by Python, and the different challenges involved:
Technical: modules and classes must be loaded and reset while carefully considering concurrency and database issues and ensuring that the system will stay usable whatever happens and without breaking existing class instances.
Also, developers must be efficient with the new system, including convenient source code edition and meaningful backtraces.
Performance: having dynamic modules and classes involved a performance tradeoff which should be kept to the minimum.
Security: as the source code is dynamically loaded from the database, extra care must be taken care of compared to filesystem source code where the source code is never supposed to change once the applications has been started.
In order to give practical examples of how this migration can be achieved, two examples will be studied and explain thoroughly, based on the experience I have acquired through the implementation for ERP5 I have worked on during the past year:
The Python logging module is a useful tool for getting all kinds of information out of your program; everything from error notifications through to debug information. The standard facilities are useful out of the box, but, sometimes, you need a bit more. Not surprisingly, it turns out that the logging module is designed to be extended. This presentation shows some of the things you can do; things like gathering statistics on message type, directing emails to different recipients depending on severity, dynamic updating of attributes, and logging to a database.
The examples are based on the notification facilities in Lokai.
The talk covers:
I’m sure there are many different ways of doing this. Some of the code might be obvious in retrospect, and some might be surprising. Whatever the case, if you havn’t thought of doing this before you might be encouraged to give it a go. And if you have done it before you can always come and heckle.
When writing code in C, the mapping between written code and compiled assembler is generally pretty well understood. Compilers employ tricks, but barring few extreme examples they’re, typically within 20% performance difference from “naive” compilation. Tools used to asses performance are usually per-function profilers, like valgrind, oprofile or gnuprof. They all can display time spent per function as well as cumultative times and call chains. This works very well for small-to-medium programs, however large, already profiled programs tend to have flat performance profile with unclear message from profilers.
To make matters even more complicated, in JITted VMs, like PyPy, mapping between assembler and high level language, like python, is very unclear and not well known. Writing “good” vs “bad” python (from the JIT perspective), can make a 20x performance difference.
This talk will cover current profilers available for Python and PyPy, as well as other tools that can be used to asses performance. I’ll also present in which cases using current tools does not give necessary information and what kind of tools can address this problem in the future.
Apps for smartphones and tablet PCs are getting the most relevant kind of software. The numbers of apps in app markets for Android, iOS and Windows Phone simply explodes. Unfortunately, almost none of them are developed with Python which is a bit of shame.
This talk covers the various mobile platforms and explains current solutions for programming apps with Python. It shows todays problems as well as possibilities, so that every listener can decide whether Python is already ready for his mobile app project.
Nel corso dell’ultimo anno abbiamo lavorato all’implementazione Python di una RESTful Web API completa. Abbiamo imparato un bel po’ di cose sui best pattern REST e, naturalmente, abbiamo messo alla prova le ben note capacità web di Python, rilasciando nel frattempo un paio di progetti Open Source. Nel corso del mio intervento condividerò quel che abbiamo imparato. Prenderemo in considerazione il problematico design di una REST API ‘pura’. Vedremo che cosa offre Python in questo campo e scenderemo infine nel dettaglio, dando una occhiata al codice che abbiamo scritto. Alcune tecnologie/stack che tratteremo sono (in nessun ordine particolare): Flask, PyMongo, MongoDB, REST, JSON, XML, Heroku. Lo sapevi? Che ti piaccia o no, c’è una REST API nel tuo futuro.
by Christian Theune
The requirements and expectations towards deployment and operations are advancing at an incredible pace. Especially the DevOps community encourages and demonstrates how system administrators can leverage methods from other areas of expertise to achieve classical goals: fewer outages, more flexibility, lower cost, higher security standards, improved reproducability and overall increased quality.
The hosting of complex, traffic-intensive web applications nowadays requires a solid and flexible infrastructure: you need to take care of all the homework first before going into the nitty gritty details of your specific application.
My talk shall demonstrate the aspects we meet on the infrastructure and service level when deploying and operating complex services. I’ll show-case how we approach the problems we face to prepare for an ever-improving future.
As many people and companies are experimenting with different approaches today, I’d love to spawn a separate discussion, maybe in an open space, to talk about why you do something different from us and what your experiences are.
The topics will specifically include: infrastructure versus service, data center operations, make-or-buy, automation, virtualisation, monitoring, help desk, SLAs, deployment checklist, staging, secrets, HTTP/S termination, load balancing, reporting
As you can see, the talk’s topics are mainly focused on methods and lines of thought. However, if you’re interest in tools - I will also mention the following on a varying level of detail: puppet, haproxy, nginx, apache, varnish, supervisor, cron, Linux, DELL, ProCurve, KVM, Nagios, RT, fabric, zc.buildout, batou
The Tor Project develops and maintains Tor, a free and open-source software that allows users to browse the web anonymously and securely. In addition, the Tor Project also develops and maintains a number of Python applications related to Tor, such as a command-line monitor, censorship scanner, network simulator, controller library, and bridge distributor. In this talk, Runa A. Sandvik will present the Tor Project, and talk about Tor and how it works. She will also introduce some of the Python projects currently under development, and explain how you can get involved and contribute with code, testing, and documentation.
In the last year we have been working on a full featured, Python powered, RESTful Web API. We learned quite a few things on REST best patterns, and we got a chance to put Python’s renowned web capabilities under review, even releasing a couple Open Source projects in the process. In my talk I will share what we learned. We will consider ‘pure’ REST API design and its many hurdles. We will look at what Python as to offer in this field and finally, we will dig further down by looking at some of the code we developed. Some of the technologies/stacks I’ll cover are (in no particular order): Flask, PyMongo, MongoDB, REST, JSON, XML, Heroku. Did you know? Like it or not, there is going to be a REST API in your future.
by Mike Müller
This tutorial provides an overview of techniques to improve the performance of Python programs. The focus is on concepts such as profiling, diffrence of data structures and algorithms as well as a selection of tools an libraries that help to speed up Python.
by Ross Lawley
This intermediate-level class will teach you techniques using the popular NoSQL database MongoDB, its driver PyMongo, and the object-document mapper MongoEngine to write maintainable, high-performance, and scalable applications. We will cover everything you need to become an effective MongoEngine/MongoDB developer from basic PyMongo queries to high-level object-document mapping setups in MongoEngine.
by Kay Hayen
With Nuitka, for the first time, there is a consequently executed approach to statically translate the full language extent of Python, with all its special cases, without introducing a new or reduced version of Python.
It is compiled, but with practically 100% compatibility. Function dictionaries work, code objects exist, frame stack works, exception tracebacks, eval, exec, closures, nested functions, meta classes, etc. it’s all there, and behaves identical.
First, I would like to start out and explain how I came to write a Python compiler, why I want it to be 100% compatible, and why I find deviations from Python unacceptable and out of scope.
Then I would like to describe where difficulties were in the implementation, what Python constructs surprised me, and where the mapping from Python to C++ left things to desire.
In this project, I learned a lot about Python, it wasn’t easy to get the full CPython test suite to run. In doing that, I have learned anecdotes and fine details of Python, that are normally hidden in daily programming, but are still useful to know.
Esp. the work on re-formulating “with” statements, “assert”, “while"/"for” as generic loops, etc. gives an interesting view on Python itself. And I would like to present it, also for the insight it gives on Python.
I will give an overview over newly developed infrastructure, aiming for type inference at compile time, and show existing stuff. I will try and explain, why I hope to have picked the right approach in this domain.
An interesting side game, is the approach to use XML representations of the internal node tree of Nuitka to discover regressions/changes in the optimizer.
Then I will also present a project road map, with the milestones for Nuitka, and why I believe this is the right plan, and how Nuitka is different from projects like “Cython” and “PyPy”.
To round it up, I would like to make a demonstration of Nuitka, and give an example for how easy it should be to contribute.
As this will be the first time, Nuitka is introduced the PyCON EU (it was only shown on PyCON DE 2011 so far). And to celebrate that, the current GPLv3 license will be lifted, and replaced with Apache 2.0 license (ASF), which is entirely liberal.
In breve: - Seguiremo il tutorial officiale di Django, pero con la metodologia TDD - primo, i test! - Inclusi i test del browser stesso con Selenium - Anche “unit test” dei model, views e forms di Django - Discussioni della filosofia TDD: cosa testare, cosa non testare, come testare… - l’Italiano del speaker non e garantito perfetto, pero
“Test-Driven Django with Selenium” o “La capra di Test incontra il pony di Django”
Questo training sarà particolarmente per in principianti, o uno che vuol’ imparare un po di:
L’idea e di seguire il tutorial officiale di Django, dunque sarà dal punto di visto dal principiante, pero a ogni punto useremo la metodologia “TDD” - costruendo dei test prima dal coding del sito.
Non sara solo i “unit test”. Si comincia con i “functional” test, usando Selenium, che permette da usare un vero browser per testare le funzione del sito, dal punto di vista del utilizzatore.
Sento una domanda: Perché dovrò ascoltare a lui?
Son’ fortunato di avere iniziato la mia carriera con una compagnie di fanatici del “Extreme Programming”, una metodologia che domanda un devozione quasi-religiosa al test. La mia conversione non era facile, posso dire che ho chiesto domande ad ogni turno, “perché fasciamo cosi, perché non possiamo andare direttamente al coding” etc etc - e posso dire che adesso son proprio convinto. Ho imparato degli migliori, e ho tutta la passione di un neofita.
Questo training sarà anche la prima volta che l’ho fatto in Italiano, allora sarà sicuramente emozionante.
by Fabio Pliger
Optimization, testing, tunning and design in sw. project can be both heaven or hell for a sw. development project. Python provides many tools to deal with these topics but by theirselves they could not be enough. The talk tries to expose techniques, self failures/success and practical tips and hints to make the right choice at the right time.
This talk will expose optimization, testing, tunning patterns ( and other critical topics ) of a python project and try to analyze the options python provides ( such as packages, techiniques and patterns/anti-patterns ) to deal with them. There is not one true way to deal with these topics and the main goal of the talks is to provide practical examples/techniques and create an active discussion with the public.
Main discussion topics:
This talk shows some interesting patterns for large scale Flask applications and how Flask extension should be structured. It also dives into some of the more unknown helpers in the Werkzeug and Jinja2 base libraries.
The goal of this talk is to share some of the things that the documentation can’t explain well by itself. Required prerequisites: basic knowledge of how Flask operates.
In this talk we present PyPedia. PyPedia is an effort to host a Python programming environment in a MediaWiki content management system. The concept is similar to any wiki except that each article contains the documentation, python source code and unit tests for a known and well defined computational problem. Through an article, a user can edit the source code, download it, execute it locally, in a remote computer through SSH, or in Google App Engine (GAE). Moreover, through a python package users can import PyPedia methods in their local python environment. In the source code, a developer can simply call a function or instantiate a class that is defined in another article. In every code edit, the article’s unit-tests are evaluated in GAE before saving. A special parameters section allows editors to build an HTML form within the article that help fellow users to execute the method as a simple online service. Articles are divided in two categories: User and Main. In User articles, the creator of the article manages the edit privileges of each section. Any non-deliberately malicious content is allowed. Main articles are selected from the pool of User articles that exhibit highly qualitative content and can be edited only by trusted users. All content is under the simplified BSD license. The vision of this project is to create an encyclopedia of documented, executable and verifiable python implementation of common algorithms or computational problems through the development of a vivid community. Specialized or user aware content is also encouraged in the User namespace. The source code of PyPedia is available under the GPL v.3 license.
Availability: http://www.pypedia.com
Video demonstration: http://www.youtube.com/watch?v=2...
by Fabrizio Toso
L’obiettivo di questo talk è quello descrivere brevemente come in azienda abbiamo utilizzato Python, QT, MySQL e altre tecnologie open source per lo sviluppo di un moderno ERP italiano, Konga http://blog.konga.it/. In particolare approfondiremo l’architettura del programma client, scritto completamente in Python e vedremo come sia possibile distribuire un’applicazione completa e cross-platform (Mac OS X, Windows e Linux) identica - o quasi - alle applicazioni scritte con i sistemi di sviluppo nativi. Particolare attenzione sarà dedicata all’integrazione di QT tramite l’uso della libreria “slewlib” e alla libreria utilizzata per la descrizione e la generazione dei report di stampa.
La buona notizia è che l’Agenzia del Territorio è in grado di fornire i dati cartografici e catastali ufficiali su tutta Italia in formato elettronico. La cattiva notizia è che tali dati sono distribuiti in vari formati proprietari scarsamente e malamente supportati dai software GIS di largo uso.
In questa presentazione mostriamo come leggere, validare, correggere e tradurre in formati standard (ad esempio shapefile) i dati del catasto terreni e fabbricati in formato CXF usando il potente stack di geoprocessing e format translation in Python. L’intero processo e numerosi dei singoli passaggi sono completamente generici e possono essere applicati alla lettura e traduzione di qualsiasi formato geografico proprietario.
B-Open ha recentemente rilasciato con licenza Open Source bgeo.catasto, una parte della propria libreria di parser e traduttori dai formati dell’Agenzia del Territorio. bgeo.catasto al momento supporta la lettura e traduzione dei dati catastali in formato CXF e dei dati censuari nei formati TER e FAB.