skip to navigation
skip to content

Planet Python

Last update: January 29, 2015 01:45 PM

January 29, 2015


eGenix.com

Python Meeting Düsseldorf - New Videos Online

The following text is in German, since we're announcing videos available from a regional user group meeting in Düsseldorf, Germany.

Was ist das Python Meeting Düsseldorf ?

Das Python Meeting Düsseldorf ist eine Veranstaltung, die alle drei Monate in Düsseldorf stattfindet und sich an Python Begeisterte aus der Region wendet.

Bei jedem Treffen werden Vorträge gehalten und anschließend in Diskussionen vertieft. Die Meetings dauern üblicherweise ca. 2 Stunden und münden anschließend in eine Restaurant-Session.

Teilnehmer kommen aus ganz Nordrhein-Westfalen, hauptsächlich allerdings aus der näheren Umgebung.

Neue Videos

Um die Vorträge auch für andere Python Enthusiasten zugänglich zu machen, nehmen wir die Vorträge auf, produzieren daraus Videos und laden diese auf unseren PyDDF YouTube Channel hoch.

In den letzten Tagen haben wir die Videos der letzten Treffen aufgearbeitet. Insgesamt sind 34 neue Videos dazugekommen. Viel Spaß damit:

Python Meeting Düsseldorf 2015-01-20

Python Meeting Düsseldorf 2014-09-30

Python Meeting Düsseldorf Sprint 2014 (2014-09-27/28)

Python Meeting Düsseldorf 2014-07-02

Python Meeting Düsseldorf 2014-04-29

Python Meeting Düsseldorf 2014-01-21

Python Meeting Düsseldorf 2013-11-19


Die vollständige Liste aller mehr als 70 Python Meeting Videos ist über unsere Video Liste verfügbar.

Weitere Informationen

Weitere Informationen und Termine rund um das Python Meeting Düsseldorf stehen auf unserer Webseite:

              http://pyddf.de/

Viel Spaß !

Marc-Andre Lemburg, eGenix.com

January 29, 2015 08:00 AM


Python Software Foundation

The PSF Brochure

Sometime back in 2011, the PSF realized that Python, although at the time a mature and widely-used language, was still unknown to many decision-makers outside of the tech world. To remedy this obstacle to Python's growth (and grave injustice), the brochure project was born.
For over two years, the brochure team, headed by PSF Director, Marc-Andre Lemburg, sought success stories and sponsors, in order to demonstrate to “CIOs and chief developers, scientists and programmers, university lecturers, teachers and students, customers, clients, managers and employees”  that Python could be the programming solution they were looking for. The brochure team also worked hard to ensure there would be no cost to the PSF membership by securing sponsors' ads to fund all printing and distribution.
Making its debut in April at PyCon 2014 in Montreal (issued in two releases of 5,000 copies each, with the first release running out almost immediately), the brochure was titled “python: a programming language changes the world.” The brochure makes clear in 32 pages of vivid detail why Python has become a leading programming language in business and industry, finance, science and research, media, education, the public sector, government, and charity worldwide. 
Python's leanness (for example, "a task that requires an average of twenty lines of code in C and seven in Java can often be done with just one line in Python”), agility and flexibility, ease of teaching and learning, capacity for system integration, along with the extremely large number of libraries available, were cited in the brochure over and over again as reasons for its use. According to Chuck Groom – Head of Engineering at the Seattle SurveyMonkey office, “The transition to Python from NET has been a great success. Our Python applications handle heavy traffic without problems. Developers have found it possible to add new features much more quickly than before. New employees get up to speed in a manner of days, and recruiting has become easier.” And other web-service providers featured in the brochure, including Google and You Tube, are just as effusive in their praise. 
Examples from science and industry also abound. ArcGIS (geographic information systems), who created the ArcPy module for data analysis conversion and management, identifies an additional benefit in describing the Python community as “an extended workbench of a company's own IT department.”  More scientific uses are described in the brochure by OpenQuakeOpenERP, and Intellovations (maker of ForecastWatch). 
Making "heavy use of Python," scientists at the European Space Agency (ESA) are able to develop software that will, in the future, be put to use on Mars to search for signs of life. And at CERN, physicists, in only 6 months, were able to replace the C++ analysis framework used for choosing experiment parameters with Python. The result, “This new system has been in use for a few years now, and many problems that could not be solved using the previous system are now literally one-liners.”
Today's film industry is also shown to be committed to Python. Companies such as Industial Light and Magic and Side Effects use Python for their animation software and to manage production processes. Accoring to Tommy Burnette, head of Global Pipeline, Lucasfilm, "Python plays a key role in our production pipeline. Without it a project the size of The Avengers would have been very difficult to pull off. From crowd rendering to batch processing to compositing, Python binds all things together."  And Blender , “a free open-source 3D content creation suite," uses Python as its primary language.
Not to be overlooked, the financial services industry is also featured as greatly reliant on Python. Examples in the brochure include Swisscom IT Services and Landesbank Baden-Wurttemberg. And companies such as eGenix.com, which provides Python-based software to the nation of Ghana for the collection of VAT revenue, point up Python's importance in contributing to developing economies.
The brochure also features several educational uses of Python that serve to empower disadvantaged learners, like One Laptop per Child (OLPC), which has provided laptop computers to over 2.5 million children and teachers in 42 countries, and the PHOENIX project (Physics with Homemade Equipment and Innovative Experiments) started in 2004 by the Inter University Accelerator Centre (IUAC) in India.
The above are just a few of the abundant and impressive stories highlighted in the PSF brochure. Visit the website or download a copy for more info about how Python is indeed "changing the world." And If you or someone you know would benefit from this type of exposure or if you have a success story you'd like to share, please let us know.



January 29, 2015 02:10 AM

January 28, 2015


Andre Roberge

Revisting an old idea...

So, it now seems certain that Python is going to have some type hinting.  I'm not too fond of the proposed syntax although it is mentioned that some special syntax may be introduced at a later time if this idea proves to be useful.  However, it does not look like an adaptation of my 10 year old idea [*] which I still prefer over the discussed alternatives, would stand a chance...

[*] By this, I mean using where as a block introducing keyword - not necessarily all the specific examples mentioned which were meant to mirror the idea of GvR's blog post at that time.



January 28, 2015 10:20 PM


Sylvain Hellegouarch

A more concrete example of a complete web application with CherryPy, PostgreSQL and haproxy

In the previous post, I described how to setup a docker image to host your CherryPy application. In this installment, I will present a complete – although simple – web application made of a database, two web application servers and a load-balancer.

Setup a database service

We are going to create a docker image to host our database instance, but because we are lazy and because it has been done already, we will be using an official image of PostgreSQL.

$ docker run --name webdb -e POSTGRES_PASSWORD=test -e POSTGRES_USER=test -d postgres

As you can see, we run the official, latest, PostgreSQL image. By setting the POSTGRES_USER and POSTGRES_PASSWORD, we make sure the container creates the according account for us. We also set a name for this container, this will be useful when we link to it from another container as we will see later on.

A word of warning, this image is not necessarily secure. I would advise you to consider this question prior to using it in production.

Now that the server is running, let’s create a database for our application. Run a new container which will execute the psql shell:

$ docker run -it --link webdb:postgres --rm postgres sh -c 'exec psql -h "$POSTGRES_PORT_5432_TCP_ADDR" -p "$POSTGRES_PORT_5432_TCP_PORT" -U test'
 Password for user test:
 psql (9.4.0)
 Type "help" for help.
 test=# CREATE DATABASE notes;
 CREATE DATABASE
 test=# \c notes \dt
 You are now connected to database "notes" as user "test".
 List of relations
 Schema | Name | Type | Owner
 --------+------+-------+-------
 public | note | table | test
 (1 row)
 notes=#

We have connected to the server, we then create the “notes” database and connect to it.

How did this work? Well, the magic happens through the –link wedb:postgres we provided to the run command. This tells the new container we are linking to a container named webdb and that we create an alias for it inside that new container. That alias is used by docker to initialize a few environment variables such as:

POSTGRES_PORT_5432_TCP_ADDR: 
   the IP address of the linked container
POSTGRES_PORT_5432_TCP_PORT: 
   the exposed port 5432 (which is quite obviously the server's port)

Notice the POSTGRES_ prefix? This is exactly the alias we gave in the command’s argument. This is the mechanism by which you will link your containers so that they can talk to each other.

Note that there are alternatives, such as weave, that may be a little more complex but probably more powerful. Make sure to check them out at some point.

Setup our web application service

We are going to run a very basic web application. It will be a form to take notes. The application will display them and you will be able to delete each note. The notes are posted via javascript through a simple REST API. Nothing fancy. Here is a screenshot for you:

notes_screen

By the way, the application uses Yahoo’s Pure.css framework to change from bootstrap.

Simply clone the mercurial repository to fetch the code.

$ hg clone https://Lawouach@bitbucket.org/Lawouach/cherrypy-recipes
$ cd cherrypy-recipes/deployment/container/webapp_with_load_balancing/notesapp
$ ls
Dockerfile webapp

This will download the whole repository but fear not, it’s rather lightweight. You can review the Dockerfile which is rather similar to what was described in my previous post. Notice how we copy the webapp subdirectory onto the image.

We can now create our image from that directory:

$ docker build -t lawouach/webapp:latest .

As usual, change the tag to whatever suits you.

Let’s now run two containers from that image:

$ docker run --link webdb:postgres --name notes1 --rm -p 8080:8080 -i -t lawouach/webapp:latest
$ docker run --link webdb:postgres --name notes2 --rm -p 8081:8080 -i -t lawouach/webapp:latest

We link those two containers with the container running our database. We can therefore use that knowledge to connect to the database via SQLAlchemy. We also publish the application’s port to two distinct ports on the host. Finally, we name our containers so that can we reference them in the next container we will be creating.

At this stage, you ought to see that your application is running by going either to http://localhost:8080/ or http://localhost:8081/.

Setup a load balancer service

Our last service – microservice should I say – is a simple load-balancer between our two web applications. To support this feature, we will be using haproxy. Well-known, reliable and lean component for such a task.

$ cd cherrypy-recipes/deployment/container/webapp_with_load_balancing/load_balancing
$ ls
Dockerfile haproxy.cfg

Tak some time to review the Dockerfile. Notice how we copy the local haproxy.cfg file as the configuration for our load-balancer. Build your image like this:

$ docker build -t lawouach/haproxy:latest .

And now run it to start load balancing between your two web application containers:

$ docker run --link notes1:n1 --link notes2:n2 --name haproxy -p 8090:8090 -p 8091:8091 -d -t lawouach/haproxy:latest

In this case, we will be executing the container in the background because we are blocking on haproxy and it won’t lok to the console anyway.

Notice how we link to both web application containers. We set short alias just by pure lazyness. We publish two ports to the host. The 8090 port will be necessary to access the stats page of the haproxy server itself. The 8091 port will be used to access our application.

To understand how we reuse the the aliases, please refer to the the haproxy.cfg configuration. More precisely to those two lines:

server notes1 ${N1_PORT_8080_TCP_ADDR}:${N1_PORT_8080_TCP_PORT} check inter 4000
server notes2 ${N2_PORT_8080_TCP_ADDR}:${N2_PORT_8080_TCP_PORT} check inter 4000

We load-balance between our two backend servers and we do not have to know their address at the time when we build the image, but only when the container is started.

That’s about it really. At this stage, you ought to connect to http://localhost:8091/ to see use your application. Each request will be sent to each web application’s instances in turn. You may check the status of your load-balancing by connecting to http://localhost:8090/.

Obviously, this just a basic example. For instance, you could extend it by setting another service to manage your syslog and configure haproxy to send its log to it.

Next time, we will be exploring the world of CoreOS and clustering before moving on to service and resource management via Kubernetes and MesOS.

January 28, 2015 08:19 PM


Andre Roberge

Scratching an itch: improving pydoc

Pydoc is great - no make that fantastic.  However, I was never fond of the look of help pages displayed when pydoc is used in webserver mode.    Pydoc uses hard-coded styling options (including font and colors) based on deprecated html 4 syntax.

I decided to see if I could make it more customizable and, after a half-day coding sprint, I offer you mod_pydoc, which is somewhat more easily customizable using css.  The new version has a simplified styling as default.

mod_pydoc is only available from github (for now); I'm hoping that people with better designing skills will contribute some code to make the output look better than my feeble attempt.  Eventually, my intention would be to file a feature request to python.org and submit it as a possible improvement on the current module.

January 28, 2015 04:20 PM


Mike Driscoll

Machine vision with Python Kickstarter

Yesterday I posted about PyImageSearch Gurus computer vision Kickstarter and then I came across another semi-related Kickstarter. This one is for Machine vision with Python using an OpenMV Cam. It uses MicroPython (Python for microcontrollers) to control a camera on a circuit board. This project can be used with an Arduino, mbed or other microcontroller over I2C, Serial, or SPI protocols. I believe the Raspberry Pi falls into one or more of the latter categories.

They haven’t reached their goal yet, but they have almost a month left to raise the funds. You can check our their project here.

January 28, 2015 02:05 PM


End Point

Getting realtime output using Python Subprocess

The Problem

When I launch a long running unix process within a python script, it waits until the process is finished, and only then do I get the complete output of my program. This is annoying if I'm running a process that takes a while to finish. And I want to capture the output and display it in the nice manner with clear formatting.

Using the subprocess and shlex library

Python has a “batteries included” philosophy. I have used 2 standard libraries to solve this problem.
import subprocess 
import shlex 
  • subprocess - Works with additional processes
  • shelx - Lexical analysis of shell-style syntaxes

subprocess.popen

To run a process and read all of its output, set the stdout value to PIPE and call communicate().
import subprocess
process = subprocess.Popen(['echo', '"Hello stdout"'], stdout=subprocess.PIPE)
stdout = process.communicate()[0]
print 'STDOUT:{}'.format(stdout)
The above script will wait for the process to complete and then it will display the output. So now we are going to read the stdout line by line and display it in the console untill it completes the process.
output = process.stdout.readline()
This will read a line from the stdout.
process.poll()
The poll() method will return
  • the exit code if the process is completed.
  • None if the process is still running.
while True:
        output = process.stdout.readline()
        if output == '' and process.poll() is not None:
            break
        if output:
            self.logger.info(output.strip())
    rc = process.poll()
The above will loop and keep on reading the stdout and check for the return code and displays the output in real time.
I had one more problem in parsing the shell commands to pass it to popen when I set the shell=False. Below is an example command:
rsync -avzXH --delete --exclude=*.swp --exclude=**/drivers.ini /media/lgisos/lg.iso root@42-a:/isodevice
To split the string using shell-like syntax I have used shlex library's split method.

Here is the final code looks like

def run_command(command):
    process = subprocess.Popen(shlex.split(command), stdout=subprocess.PIPE)
    while True:
        output = process.stdout.readline()
        if output == '' and process.poll() is not None:
            break
        if output:
            self.logger.info(output.strip())
    rc = process.poll()
    return rc

January 28, 2015 09:38 AM


Zato Blog

Zato 2.0 released - ESB, SOA, REST, APIs and Cloud Integrations in Python

The new version of Zato - the open-source middleware platform and backend application server - has just been released.

https://zato.io/docs

Release 2.0 brings dozens of interesting features building on and greatly enriching already existing capabilities.

Major features include:

The changelog lists all the updates that are in addition to what Zato has had since the initial release: clustering, scheduling, hot-deployment, GUI, CLI, statistics, Plain HTTP, SOAP, AMQP, FTP(S), JMS WebSphere MQ, ZeroMQ and more.

Check out the no-nonsense introduction to ESB/SOA for an introduction to the philosophy behind the project and just have a look at the following sample screenshots depicting but a small part of the platform in action:

Screenshot Screenshot Screenshot Screenshot Screenshot Screenshot

January 28, 2015 05:01 AM


Doug Hellmann

virtualenvwrapper.django 0.4.1

virtualenvwrapper.django 0.4.1

What is virtualenvwrapper.django?

virtualenvwrapper.django is a template plugin for virtualenvwrapper to create new Django projects automatically. When used with mkproject, it installs Django into the new virtualenv then runs django-admin.py to create a new project skeleton.

What’s New?

This release replaces the use of distribute with setuptools (contributed by Sascha Peilicke).

January 28, 2015 05:00 AM


Vasudev Ram

HTML text to PDF with Beautiful Soup and xtopdf

By Vasudev Ram



Recently, I thought of getting the text from HTML documents and putting that text to PDF. So I did it :)

Here's how:
"""
HTMLTextToPDF.py
A demo program to show how to convert the text extracted from HTML
content, to PDF. It uses the Beautiful Soup library, v4, to
parse the HTML, and the xtopdf library to generate the PDF output.
Beautiful Soup is at: http://www.crummy.com/software/BeautifulSoup/
xtopdf is at: https://bitbucket.org/vasudevram/xtopdf
Guide to using and installing xtopdf: http://jugad2.blogspot.in/2012/07/guide-to-installing-and-using-xtopdf.html
Author: Vasudev Ram - http://www.dancingbison.com
Copyright 2015 Vasudev Ram
"""

import sys
from bs4 import BeautifulSoup
from PDFWriter import PDFWriter

def usage():
sys.stderr.write("Usage: python " + sys.argv[0] + " html_file pdf_file\n")
sys.stderr.write("which will extract only the text from html_file and\n")
sys.stderr.write("write it to pdf_file\n")

def main():

# Create some HTML for testing conversion of its text to PDF.
html_doc = """
<html>
<head>
<title>
Test file for HTMLTextToPDF
</title>
</head>
<body>
This is text within the body element but outside any paragraph.
<p>
This is a paragraph of text. Hey there, how do you do?
The quick red fox jumped over the slow blue cow.
</p>
<p>
This is another paragraph of text.
Don't mind what it contains.
What is mind? Not matter.
What is matter? Never mind.
</p>
This is also text within the body element but not within any paragraph.
</body>
</html>
"""

pw = PDFWriter("HTMLTextTo.pdf")
pw.setFont("Courier", 10)
pw.setHeader("Conversion of HTML text to PDF")
pw.setFooter("Generated by xtopdf: http://slid.es/vasudevram/xtopdf")

# Use method chaining this time.
for line in BeautifulSoup(html_doc).get_text().split("\n"):
pw.writeLine(line)
pw.savePage()
pw.close()

if __name__ == '__main__':
main()


The program uses the Beautiful Soup library for parsing and extracting information from HTML, and xtopdf, my Python library for PDF generation.
Run it with:
python HTMLTextToPDF.py
and the output will be in the file HTMLTextTo.pdf.
Screenshot below:


- Vasudev Ram - Python training and programming - Dancing Bison Enterprises

Read more of my posts about Python or read posts about xtopdf (latter is subset of former)

Signup to hear about my new software products or services.


Contact Page

January 28, 2015 03:18 AM

January 27, 2015


François Dion

A new blog on future tech and innovation

I invite you to visit and bookmark my multilingual future tech / innovation / 3D blog. I just started it, and I think you'll like it:

http://3dfuturetech.blogspot.com/

There might be some cross posts, particularly since Python and the Raspberry Pi are used in so many innovations.

January 27, 2015 10:52 PM


Ian Ozsvald

Annotate.io self-learning text cleaner demo online

A few weeks I posted some notes on a self-learning text cleaning system, to be used by data scientists who didn’t want to invest time cleaning their data by hand. I have a first demo online over at annotate.io (the demo code is here in github).

The intuition behind this is that we currently divert a lot of mental resource early in a project to cleaning data and a bunch of that can be spent just figuring out which libraries will help with the cleaning. What if we could just let the machine do that for us? We can then focus on digging into new data and figuring out how to solve the bigger problems.

With annotate.io you give it a list of “data you have” and “data you want”, it’ll figuring out how to transform the former into the latter.  With the recipe it generates you then feed in new data and it performs the cleaning for you. You don’t have to install any of the libraries it might use (that’s all server-side).

Using Python 2.7 or 3.4 you can run the demo in github (you need the requests library). You can sign-up to the announce list if you’d like to be kept informed on developments.


Ian applies Data Science as an AI/Data Scientist for companies in ModelInsight, sign-up for Data Science tutorials in London. Historically Ian ran Mor Consulting. He also founded the image and text annotation API Annotate.io, co-authored SocialTies, programs Python, authored The Screencasting Handbook, lives in London and is a consumer of fine coffees.

January 27, 2015 10:51 PM


Mike Driscoll

The PyImageSearch Gurus Kickstarter for Computer Vision

I’ve actually never heard of this guy, but the fellow behind the pyimagesearch blog has created a Kickstarter for a computer vision subscription course. His name is Adrian Rosebrock and his Kickstarter was funded in 25 minutes! His course covers a lot of different topics in computer vision and sounds really interesting. You should definitely check it out, especially if you’re in this field.

January 27, 2015 08:09 PM


Tarek Ziade

Charity Python Code Review

Raising 2500 euros for a charity is hard. That's what I am trying to do for the Berlin Marathon on Alvarum.

Mind you, this is not to get a bib - I was lucky enough to get one from the lottery. It's just that it feels right to take the opportunity of this marathon to raise money for Doctors without Borders. Whatever my marathon result will be. I am not getting any money out of this, I am paying for all my Marathon fees. Every penny donated goes to MSF (Doctors without Borders).

It's the first time I am doing a fundraising for a foundation and I guess that I've exhausted all the potentials donators in my family, friends and colleagues circles.

I guess I've reached the point where I have to give back something to the people that are willing to donate.

So here's a proposal: I have been doing Python coding for quite some time, wrote some books in both English and French on the topic, and working on large scale projects using Python. I have also gave a lot of talks in Python conferences around the world.

I am not an expert of any specific fields like scientific Python, but I am good in "general Python" and in designing stuff that scales.

I am offering one of the following service:

The contract (gosh this is probably very incomplete):

Interested ? Mail me! tarek@ziade.org

And if you just want to give to the fundraising it's here: http://www.alvarum.com/tarekziade

January 27, 2015 07:23 PM


Django Weblog

Bugfix releases issued: 1.7.4 and 1.4.19

Today we're issuing bugfix releases in the 1.7 and 1.4 release series (the latter to correct a regression in the latest security release).

Details can be found in the release notes:

The release packages and checksums are available from our downloads page, as well as from the Python Package Index. The PGP key ID used for this release is Tim Graham: 1E8ABDC773EDE252.

January 27, 2015 05:24 PM


Caktus Consulting Group

Django Logging Configuration: How the Default Settings Interfere with Yours

My colleague Vinod recently found the answer on Stack Overflow to something that's been bugging me for a long time - why do my Django logging configurations so often not do what I think they should?

Short answer

If you want your logging configuration to behave sensibly, set LOGGING_CONFIG to None in your Django settings, and do the logging configuration from scratch using the Python APIs:

LOGGING_CONFIG = None
LOGGING = {...}  # whatever you want

import logging.config
logging.config.dictConfig(LOGGING)

Explanation

The kernel of the explanation is in this Stack Overflow answer by jcotton; kudos to jcotton for the answer: before processing your settings, Django establishes a default configuration for Python's logging system, but you can't override it the way you would think, because disable_existing_loggers doesn't work quite the way the Django documentation implies.

The Django documentation for disable_existing_loggers in 1.6, 1.7, and dev (as of January 8, 2015) says "If the disable_existing_loggers key in the LOGGING dictConfig is set to True (which is the default) the default configuration is completely overridden." (emphasis added)

That made me think that I could set disable_existing_loggers to True (or leave it out) and Django's previously established default configuration would have no effect.

Unfortunately, that's not what happens. The disable_existing_loggers flag only does literally what it says: it disables the existing loggers, which is different from deleting them. The result is that they stay in place, they don't log any messages, but they also don't propagate any messages to any other loggers that might otherwise have logged them, regardless of whether they're configured to do so.

What if you try the other option, and set disable_existing_loggers to False? Then your configuration is merged with the previous one (the default configuration that Django has already set up), without disabling the existing loggers. If you use Django's LOGGING setting with the default LOGGING_CONFIG, there is no setting that will simply replace Django's default configuration.

Because Django installs several django loggers, the result is that unless you happened to have specified your own configuration for each of them (replacing Django's default loggers), you have some hidden loggers possibly blocking what you expect to happen.

For example - when I wasn't sure what was going on in a Django project, sometimes I'd try just adding a root logger, to the console or to a file, so I could see everything. I didn't know that the default Django loggers were blocking most log messages from Django itself from ever reaching the root logger, and I would get very frustrated trying to see what was wrong with my logging configuration. In fact, my own logging configuration was probably fine; it was just being blocked by a hidden, overriding configuration I didn't know about.

We could work around the problem by carefully providing our own configuration for each logger included in the Django default logging configuration, but that's subject to breaking if the Django default configuration changes.

The most fool-proof solution is to disable Django's own log configuration mechanism by setting LOGGING_CONFIG to None, then setting the log configuration explicitly ourselves using the Python logging APIs. There's an example above.

The nitty-gritty

The Python documentation is more accurate: "disable_existing_loggers – If specified as False, loggers which exist when this call is made are left enabled. The default is True because this enables old behavior in a backward- compatible way. This behavior is to disable any existing loggers unless they or their ancestors are explicitly named in the logging configuration."

In other words, disable_existing_loggers does literally what it says: it leaves existing loggers in place, it just changes them to disabled.

Unfortunately, Python doesn't seem to document exactly what it means for a logger to be disabled, or even how to do it. The code seems to set a disabled attribute on the logger object. The effect is to stop the logger from calling any of its handlers on a log event. An additional effect of not calling any handlers is to also block propagation of the event to any parent loggers.

Status of the problem

There's been some recent discussion on the developers' list about at least improving the documentation, with a core developer offering to review anything submitted. And that's where things stand.

January 27, 2015 04:04 PM


Django Weblog

Django Fellowship fundraising goal achieved!

YAY! Thanks to the amazing help from the Django community all over the world, we just crossed the Django Fellowship Fundraising campaign goal of US $30,000 with a significant donation from the Django Under The Hood conference and the Django Dutch Association.

You. Are. All. Awesome.

We are incredibly grateful for your continuous support and encouragement. More than 150 companies and individuals helped us to continue the Django Fellowship Program in just under 6 days. This exceeds all of our wildest expectations. The Django community is what makes all the work that the contributors and volunteers put into development of Django worthwhile. Thanks to you, we will be able to develop and maintain Django in a more stable and consistent way, with better code reviews and timely releases.

The next goal

Of course, there is always more that can be done and we don’t want to stop here. We also realize that ending this campaign just after 6 days would mean that lots of people and companies would not get an opportunity to contribute and help the cause they care about.

This is why we’ve decided to extend the goal to US $50,000, which would allow the Django Software Foundation to expand the program even further.

Once we reach the goal of US $50,000, we will focus on making the program sustainable by making it easy for everyone to create a smaller recurring donation and fill the Django heart with pixels of love on a monthly basis. This will allow the Foundation to carry on with the work without contributing a significant resources and time for fundraising campaign every quarter.

Help us spread the word

Despite an amazing effort coming from the whole community, we know that our message hasn't reached everyone yet. And there are a lot more Django users and companies that can help us make it happen. So please, talk to the companies you work for and let us know how we can help them. There are always alternative ways to donate or partner with the Django Software Foundation. We would be more than happy to find a solution that works for everyone and we’re very open to hear your thoughts. Get in touch with us here.

January 27, 2015 02:43 PM


Python Diary

Building a Telnet client in my PyGame VGA Console project

I am sure most of you recall my post on the VGA compatible framebuffer display in PyGame I released. I am equally sure that you also heard of my open source hacking simulation engine I released yesterday. Well, this evening I thought I'd create a new example app for my PyGame VGA framebuffer project, this app is in the form of a basic telnet client which can talk to my hacking simulation engine server. This client will eventually be used in my Hacker's Edge massively multiplayer online hacking universe game, or MMOHUG for short. While the server for the game world will be closed source, the desktop client will be open sourced and available to anyone to modify and improve or use for their own similar game. Here is a screenshot of how it currently looks:

Here is how simple it was to create such a program using my powerful VGA framebuffer console for PyGame:

import asynchat, sys, asyncore, socket, threading, time
import vgaconsole, cmd, pygame, sys, shlex, subprocess

class TelnetClient(asynchat.async_chat):
    def __init__(self, console):
        asynchat.async_chat.__init__(self)
        self.console = console
        self.set_terminator(None)
        self.create_socket(socket.AF_INET, socket.SOCK_STREAM)
        console.stdio.write('Connecting to Hacker\'s Edge...')
    def handle_connect(self):
        self.console.stdio.write('connected!\n')
    def handle_close(self):
        self.console.stdio.write('Disconnected.\n')
        self.close()
    def transmit(self, data):
        self.push(data+'\r\n')
    def process_iac(self, iac):
        if iac[2] == chr(1):
            if iac[1] == chr(251):
                self.console.mask_input = '*'
            elif iac[1] == chr(252):
                self.console.mask_input = None            
    def collect_incoming_data(self, data):
        if chr(255) in data:
            iac = data.index(chr(255))
            self.process_iac(data[iac:iac+3])
            if iac == 0:
                data = data[3:]
            else:
                data = data[:iac]+data[iac+3:]
        self.console.stdio.write(data.replace('\r\n', '\n'))

class ConsoleApp(vgaconsole.VGAConsole):
    cursor_klass = vgaconsole.AnimatedCursor
    def init(self):
        self.set_color(2,0)
        self.telnet = TelnetClient(self)
    def parse(self):
        self.stdio.write('\n')
        line = self.stdio.read()
        self.telnet.transmit(line)

def main():
    pygame.display.init()
    screen = pygame.display.set_mode((640,400),0,8)
    pygame.display.set_caption("Hacker's Edge Single Player client")
    vga = ConsoleApp(screen)
    vga.init()
    vga.draw()
    pygame.display.update()
    try:
        vga.telnet.connect(('hackers-edge.com', 4000))
        client_thread = threading.Thread(target=asyncore.loop, kwargs={'timeout':1})
        client_thread.start()
    except socket.gaierror, e:
        vga.stdio.write('failed!\n%s' % e)
    while True:
        vgaconsole.clock.tick(30)
        events = pygame.event.get()
        for e in events:
            if e.type == vgaconsole.QUIT:
                vga.telnet.close()
                client_thread.join()
                pygame.quit()
                sys.exit()
            if vga.telnet.connected:
                if e.type == vgaconsole.KEYDOWN and e.key == 13:
                    vga.parse()
                else:
                    vga.handle_event(e)
        try:
            vga.draw()
        except:
            print sys.exc_info()
            pass
        pygame.display.update()

if __name__ == '__main__':
    main()

Isn't that easy? I hopefully made this VGA console easy to program and integrate into mostly any Python app that needs a cross-platform SDL console available. It's available via my Bitbucket page like every other open source project I have.

January 27, 2015 12:00 PM


PyCon

A look at how Caktus Group built PyCon 2015, Libya's SMS voter registration, and more

Each July, the launch of the upcoming year's conference website is a huge moment for the PyCon team and community. It's a beacon to everyone that another PyCon is on the way, and a sign that the various teams that shape the event are already hard at work to prepare for it. For yet another year, we have a beautiful site in front of us: https://us.pycon.org/2015, designed and implemented by long time sponsor Caktus Group.

As with years past, the site is built on Django and Symposion, a conference management framework in use by several conferences in the Python community and otherwise. Caktus' prior involvement with that combination of technologies meant "we were able to concentrate on bug fixes and small features that make a big difference to the conference organizers," according to Rebecca Muraya, Caktus' lead developer on the PyCon 2015 site. Having been around the block with that stack has resulted in a higher quality site, and left more time to spend on the visual aspects of the site.

"One of the few requirements was the design should have color and energy and something that tied to the Palais [des congrès de Montréal]," Trevor Ray, lead designer, said of our request to include the vibrant colors found inside and out of the venue. Beyond the structure, what happens inside was equally as important to represent in the design, especially the talks - both on stage and in the hallways.


"Fueled by this idea, we focused on creating a design that communicated the idea of diversity, mingling crowds, and the energy you feel while you’re at a truly great conference. We wanted the colors to talk about PyCon, not only the Palais," said Trevor of the flowing snake-like colored ribbon.

Having spent nearly all of my time outside of talks the last few years, I saw this immediately. The free flowing nature of the color stream crossing back on itself, looping around, randomly appearing out of the sides as you scroll down the front page - that's a walk through the halls of PyCon to me. The size, direction, and shape of each color in the ribbon changing represents the different conversations with different groups going in slightly different directions at each step.

"It was both a great challenge and a wonderful opportunity to create a design for PyCon 2015. With the great feedback of the PyCon organizers and the input from the entire Caktus team I think the project has been a great success," said Trevor.

All the while, Caktus has been busy continuing work with iN DEMAND, one of the largest providers of pay-per-view and video on demand services. According to Hao Nguygen, through their work with iN DEMAND they've uploaded 1.3 petabytes of movies into the system. They're also working with the International Rescue Committee, a group which helped over 13 million people affected by humanitarian crises around the world. "Our portfolio really emphasizes projects that are complex and highly scalable since that, for us, is where it gets interesting, where high quality code matters most," says Hao.

One of the most interesting pieces of their portfolio is the work they've done to implement SMS voter registration in Libya. Due to the ubiquity of SMS technology in Libya, where there are 163 cell phone subscriptions per 100 Libyans as of 2013, the government mandated that registration be carried out via SMS.

In order to build the system, Caktus went with RapidSMS, a Django-based SMS framework. "We’ve implemented RapidSMS applications for UNICEF in Rwanda, Malawi, and Zambia," said Tobias McNulty, CEO of Caktus, experience which helped them build the Libyan system that saw 1.5 million registrants across two elections.

Tobias went on to mention how political instability raised the stakes not only for delivery of the project within time and budget constraints, but how that instability led to the need for a system that
didn't rely on in-person registration. A Caktus case study mentioned 78 in-person registration stations having been forcibly closed by violence in December 2013, among the many reasons why an SMS system was needed by the Libyan High National Elections Commission.

"Our software integrates with Vumi, an application focused on connecting to mobile network operators in a very scalable fashion," said Vinod Kurup, Caktus' lead developer on the registration project. The application is built on top of Twisted, with heavy use of Celery to offload their message processing. Deployment is managed with Fabric and Salt. They also got a lot of use out of Django and a host of Django libraries under the hood.


"As you can see, one of the major reasons that Python is attractive is that it can handle so many diverse aspects of the application, from the web, to the SMS backend, to asynchronous processing, to mobile network connectivity, to deployment," continued Vinod. "The combination of simplicity and power made it an obvious choice for this project."


Beyond development projects, Caktus is currently building out classroom space and curriculum for their upcoming Python and Django courses. Called Astro Code School, the three and twelve week courses are heading for a spring time launch, with plans for corporate training as well.

As for PyCon itself, Caktus is looking forward to getting back to Montreal for another year. "Aside from manning our booth, we’re hoping to attend talks, say hello to folks we know, and meet new people," says Hao, so go up and introduce yourself. They're also sponsoring Django Girls and PyLadies as well!

January 27, 2015 11:42 AM


ShiningPanda

And the winner is...

As you may know, requires.io is all about being notified of outdated dependencies on PyPI packages.

Therefore we are a privileged observer of the Python community, and it was high time we release some data!

We'll share some more in the upcoming weeks, but let's start with the most popular packages expressed as the percentage of repositories (followed by requires.io) that depends on them:

Statistics

The result will not come as a surprise: Django is number one with almost 33% of the projects depending on it. We were also quite happy to notice that quality related tools (like coverage, mock, flake8, etc.) rank quite high on the list, evidence that the Python community cares a lot about code quality!

To package maintainers: not on the list? Send us an email and we'll share figures with you.

Stay tuned!

January 27, 2015 07:00 AM

January 26, 2015


Brett Cannon

Alternative voting systems for Canada

With 2015 bringing a federal election where current polling suggests that either the Liberals or Conservatives could have a minority government based on how people vote, I’m rather interested in how election systems could influence the outcome. Last month there was an article about two alternative voting systems and how they would influence the elections. While reading into these systems I also found out that voting system reform is not a new thing in Canada and that both the NDP and Liberals have actually discussed changing how federal elections work after the 2015 election. With the importance of this election being so high – the Conservatives have been the ruling party since 2006 with a majority since 2011 and so it is expected they will at minimum lose their majority stance – I decided to try and learn what alternative voting systems are being proposed and how they would influence the political landscape in Canada.

Quick primer on Canada’s federal government

Canada’s government is based on the Westminster system where there is Parliament made up of representatives elected by the public. Each member of Parliament – known as an MP – is elected by a riding of which the largest is just over 180,000 people but hovers more around 100,000 nationally (which I have been told is one of the best ratios of people to representative in the world). The political party with the most number of representatives appoint the prime minister – who is always the party leader – who is known at the PM. Federal elections are called whenever Parliament is dissolved which typically occurs when a majority of MPs vote for elections to occur.

One key thing to realize about this kind of system is that whenever a party has a majority government – which cannot last longer than 5 years by law and what Canada currently has – they can basically pass any law they want as long as the Senate signs off on it (which they almost always do). The only check on Parliament then comes from the Queen of England and the Governor General who is the Queen’s representative in Canada. Either of these two people can dissolve Parliament and are the only people who can do so (when Parliament votes to dissolve Parliament it’s just a suggestion to the Governor General).

We also have five national parties: Conservatives, Liberals, NDP, Greens, and Bloc Quebecois. The first three are the big ones while the Greens are fairly new and only have 2 MPs and the Bloc is exclusively from Quebec and only have 2 MPs. In other words fairness in voting is a big deal here since voting is not a binary choice.

First-past-the-post voting (what the Conservatives want and what the current system is)

The voting system currently used in Canada is called first-past-the-post (abbreviated FPTP). In this system you get a single vote and you cast it for the person who you want to win. The person with the largest number of votes wins the election. Very simple.

Unfortunately it also leads to disproportionate representation. Let’s pretend we have a total of 3 MPs named Brett, Andrea and Gidget. Each MP represents a riding made up of 10 people. Brett is a Liberal and gets elected by 6 votes with the other 4 going to the Greens. Andrea is also elected by a 6-4 vote along Liberal/Greens party lines. Gidget, though, gets all 10 votes in her riding and she is a Green representative. So while Parliament would be split 2-1 Liberal/Greens, the 30 voters actually voted 12-18 Liberal/Greens. In other words while people as a region voted more for Greens than Liberals, because of the way first-past-the-post works the Liberals are actually the party in power.

This example shows why sacrificial voting is caused by first-past-the-post. In our example, it obviously is not worth voting for the Greens if you know they won’t win your riding, regardless of whether you think they are the best party to run Canada. And so people end up voting for the best party they think can win instead of the best party period. While a two-party system like they have in the United States doesn’t really need to worry about this so much, in Canada where there are five officially recognized political parties at the federal level, sacrificial voting is definitely something one has to take into consideration, e.g. I might prefer the Greens but if I would rather the Liberals win out in a close race against the Conservatives I would be compelled to vote for the Liberals to help make sure the least bad result which actually has a chance of occurring.

Alternative voting (what the Liberals want)

Also known as instant-runoff voting, alternative voting – abbreviated AV – is a voting system where you rank the candidates in order of preference. Once all votes are cast each ballot counts as a single vote for the person’s top choice. If no one got a majority of votes, then the candidate with the fewest votes is eliminated and then the ballots are counted again. In this next round, though, any ballot that cast the now-eliminated candidate as their primary choice shift to having their second pick count as their vote. This process of elimination and shifting who gets the vote from a ballot continues until someone gets a majority of votes. Or another way of looking at it is imagine everyone casts their votes for their top choice, if there is no clear winner then the least popular person is eliminated, and then there is an instant-runoff where everyone votes again with one less person to consider (this is where the name of the system comes from).

In Canada, AV is used to elect the leaders of the Liberal and Conservative parties. It’s also used in Australia to elect members of their House of Representatives.

AV does a better job of proportional representation than FPTP which is obviously good. It also makes key ridings less important as you may not win a riding simply by having the most #1 votes if it’s less than a majority while someone else has a majority of #2 votes.

FPTP is not flawless though, as it does lead to collusion between parties in telling people to vote specific parties lower than another one. The idea is that I will tell my constituents to put you second if you tell your constituents to put me second. So there is room to influence votes with AV.

Mixed-member proportional representation (what the NDP and Greens want)

Abbreviated MMP, mixed-member proportional representation has a somewhat interesting history in Canada. Back in 2004, the Law Commission of Canada – de-funded since 2011 – released a report suggesting MMP would be a good voting system for Canada (PDF; relevant discussion of MMP is in Section 4.4 starting on page 83 of the printed text, page 105 of the PDF). So what is MMP and why was it suggested for Canada (and is already used in New Zealand and Germany among others for their federal elections)?

In MMP you vote for two separate things. First you vote for the party you want to lead the federal government. Second, you vote for the person you want to represent you. In both FPTP and AV this is one and the same vote which means if you don’t like the person running in your riding but they represent the party you want to run the country then you have to decide which is more important to you. But in MMP who you think can represent your riding the best is not conflated with what political party should be setting the agenda in Ottawa. Think of it as you’re voting for the party you want running the federal government and you’re separately suggesting the individual you want to personally represent you regardless of what party they represent.

The other interesting aspect of MMP is how these two seemingly separate votes consolidate with each other so that you end up with a representative government that is proportional to what your region wants. For each riding, the representative MP that you directly voted for wins based on first-past-the-post. These elected riding MPs make up 2/3 of all MPs representing a region (which can be as big as a province). The remaining 1/3 of MPs are filled based on how many MPs a party would need to top up their MP count to more accurate represent the party vote in the region.

These “filler” MPs are called list MPs because they are essentially pulled from a list provided by the party (the Law Commission of Canada suggested letting people either vote for specific list MPs that they preferred or simply vote for a party and let that party choose which list MP would get that vote, that way people can choose how involved they want to be in choosing their list MPs; pulling from the list exclusively is called closed list MPs, always voting for the list MP is called open list, and allowing either is called mixed list).

Consider a region with 10 MPs: 6 riding MPs and 4 list MPs. Let’s also say that the Liberals got 50% of the party vote along with 3 riding MPs elected. That would mean the Liberals get 2 list MPs since the region said they should make up 50% of the government but fell short in the riding MP votes by 2 representatives. Notice how voting for a riding MP does not mean you can vote for your party twice; if you voted in a Liberal MP and voted for the Liberal party you don’t get to make 2 MPs suddenly appear for the Liberals, just that you got to help select one of the Liberal MPs directly because you liked them personally. A good example of how this whole thing works can be found in the Law Commission of Canada’s findings on printed page 94.

A huge effect of MMP is that minority parties can get much larger representation in government. Since your party vote directly correlates to proportional representation for your region it means you can vote for e.g., the Greens knowing that your votes actually counts towards them representing you in Parliament. This more favourable representation is why the NDP actually brought a vote on MMP this past December and have a petition to try and change the voting system in Canada after the 2015 election.

MMP is not perfect, though. Your vote can still not count the same as someone in another region based on how the number of MPs a region represents is divided. In some places that use MMP they solve this by having the list MPs be filled in nationally so that everyone’s vote is equal (this wouldn’t work in Canada for historical reasons, but basically certain provinces and all territories have minimum representation guarantees in Parliament and so having overflow representation would break those guarantees). But compared to both FPTP and AV, MMP usually has the better representation of voter intent.

The other issue is the size of the ballot. With a mixed list vote you would have a ballot listing all of the riding MPs you have to choose from and then you would have the mixed list vote where you either vote for a party generally or vote for a list MP specifically which could be as long as 15 people. I have looked at the example ballot and it isn’t complex, but it definitely isn’t small if you have up to 5 parties listing 15 people each for their listing MP votes (this is more of a technicality and is a solvable problem, but it is something to consider).

My personal opinion

After reading about all of these voting systems, I have to admit that MMP appeals to me the most. It comes the closest to making sure my vote for a party actually leads to representation by that party in Parliament. I also appreciate that my personal representation in Parliament by an MP is a separate vote and does not impact which party I want to represent me.

It also has the side-effect that majority governments would become a rarity. With small parties able to win more seats it leads to more compromise and teamwork between parties in order to get legislation passed. MMP just seems the most fair, and as a Canadian I like being fair.

January 26, 2015 10:56 PM


Stéphane Wirtel

PythonFOSDEM 2015 - Last news

Dear Python Community,

This year, we are really proud to announce there will be a great event in Belgium, the FOSDEM. The FOSDEM is the Free and Open source Software Developer’ European Meeting, a free and non-commercial two-day week-end that offers open source contributors a place to meet, share ideas and collaborate.

It’s the biggest event in Europe with +5000 hackers, +400 speakers.

For this edition, Python will be represented by its Community. If you want to discuss with a lot of Python Lovers, it’s the place to be!

Like every year, FOSDEM 2015 will take place on 31st January and 1st February in Brussels (Belgium).

We will have a room in the H building (200 seats) of the University Libre of Brussels, with a VGA video project and Wireless Internet.

Of course, we will have a Python booth for you, if you desire to discuss with us or with some members of the Community ;-) You are welcome.

PythonFOSDEM: http://www.python-fosdem.org

Goodies of this edition 2015

PythonFOSDEM 2015 PythonFOSDEM 2015 PythonFOSDEM 2015 PythonFOSDEM 2015 PythonFOSDEM 2015 PythonFOSDEM 2015 PythonFOSDEM 2015 PythonFOSDEM 2015

Here are the dates

  • Friday Evening: FOSDEM will organise a Beer Event at Delirium Café.
  • Saturday:
    • Devroom: During the day, there will be 16 talks, see the schedule
    • Booth:
      • You can come to discuss with us about Python and the community. There will be a sign party with Harry Percival and his book "Test-Driven Development with Python"
      • T-shirts and Plush snake to buy.
    • Evening: There is a drink for the Python Community and a restaurant, just after the talks. For this part, you need to register you on this Doodle because we have to know the number of attendees for the restaurant ;-) We already are 70 for the restaurant.
  • Sunday
    • Booth: I think we can try to implement a new keyword for Python or discuss with some developers of CPython

This devroom will be open all day Saturday, 31st January.

The Python Devroom

PythonFOSDEM 2015 PythonFOSDEM 2015 PythonFOSDEM 2015 PythonFOSDEM 2015 PythonFOSDEM 2015

On Saturday evening

PythonFOSDEM 2015 PythonFOSDEM 2015 PythonFOSDEM 2015 PythonFOSDEM 2015 PythonFOSDEM 2015 PythonFOSDEM 2015

Questions & Volunteers

Any questions, and volunteers, please mail to info@python-fosdem.org.

If you want to keep informed for this edition, you can follow our twitter account PythonFOSDEM .

Thank you,

Best regards,

The Team PythonFOSDEM

PythonFOSDEM 2015

January 26, 2015 07:43 PM


François Dion

Rocket man and the Near Space Circus

Space = rockets


That's what we tend to equate, cause we love them rockets... And, to reach space, it does require a rocket of some sort, at this point. To "explore" space however, at a minimum, only requires a cloudless night, away from the city, and there, with the naked eyes, you can watch the stars, not just a few, but hundreds (some apparently can see upwards of 3000!). Or perhaps you choose a full moon. One can get pretty close even with a 35mm or digital camera with a modest zoom and a tripod.

The Moon, Sept. 9th 2014, DSLR at 270MM

Albedo 0.39


The Moon is nice and all, and is great for black and white photography. And there is nothing wrong with that. In fact, there was an interesting talk back in 2012 by Fred Alger, at PyCarolinas: "Sysadmining Python to the Moon". But the blue planet, the earth is a lot more impressive (picture from that talk):

curvature.jpg

Except that we are back to rockets again? Or are we? Both Fred's talk and mine that year talked about a near space option.

Near Space


Weather balloons will get you into near space. Space officially starts at 100KM, but one can reach 35-40KM with a latex balloon filled with Helium. Add a parachute, a radar reflector and a payload, and you have your own little private launch and recovery system.

And nowadays, the payload options are numerous. The main thing is that we are no longer limited to sending microcontrollers, but can send actual computers running an operating system, and executing Python code.

An obvious candidate is the Raspberry Pi. Dave Akerman (whom I had mentionned in my talk) has been sending them into space for well over two years now. So when he sent a tweet earlier this month about the Global Space Balloon Challenge, I knew this would be the perfect project for our local Python user group, using a payload with Raspbian Linux and Python on a Raspberry Pi model A+. So many projects are possible within this project.

Hence, Team Near Space (Flying) Circus was born. Let's hope the snake and the penguin will play nice up there...

François
@f_dion

January 26, 2015 05:59 PM


Mike Driscoll

PyDev of the Week: Andrea Gavana

Andrea Gavana is this week’s PyDev of the Week. He has been quite active in the wxPython project both as a contributor of original widgets and a great help to many of the people who have asked questions on the wxPython mailing lists. I’ve known him for quite a while. Let’s see what he has to say!

Can you tell us a little about yourself (hobbies, education, etc):

I come from Milan, Italy, and I studied Chemical Engineering: I was lucky enough to participate to an exchange program sponsored by my first employer (Eni) and the university (Politecnico di Milano), so I completed my master in Italy and Canada at the same time. I’m currently based in Denmark and I work as a Reservoir Engineer in Maersk Oil.

One of my favorite hobbies is Python coding, mostly directed towards Open Source frameworks, but I also like cycling and swimming – especially if I can go to the swimming pool with my daughter!

Why did you start using Python?

I love this question, I get it all the time when other people see me using Python and also during the Python course for Reservoir Engineers I just taught internally for Maersk Oil… Back in 2003 I was using Matlab to write user interfaces and pre/post process reservoir simulation data, but I grew increasingly frustrated by the limitation of Matlab as a generic framework and relatively scarce GUI capabilities. So I asked around in various forums and someone suggested me to look at Boa Constructor (a GUI builder tool based on wxPython). And, in about zero time, I was hooked to Python. The beauty, simplicity and power of the language still amaze me now, 10 years after I started learning and using it.

I have to say that I approached Python from the wrong side of the learning curve, as from the very beginning I threw myself in the GUI world – before learning the basics – and this is not something a new user should do. GUI programming is one of the most complex tasks you can do in any language, not because the coding is more complicated, but because you have to write your GUI to provide the most seamless “user experience”, as others (non-programmers) are the final users of your product.

What other programming languages do you know and which is your favorite?

Well, my favorite remains Python by a long stretch. But I code in Fortran as well, especially for heavily intensive numerical simulations, and then I bridge my Fortran routines to Python using the excellent f2py and voila’ – I have the speed of Fortran with the beauty of Python, all in one pot. I also know Matlab, but it’s been a while since I touched it, and I did a bit of programming in C# in the last couple of years.

What projects are you working on now?

Due to very heavy work and personal commitments, I am unfortunately a bit inactive in the Open Source world these days… However, I am still the official maintainer of the AGW library, a collection of owner-drawn, generic widgets for the amazing wxPython GUI framework. I have also contributed a couple of user interfaces to the Open Source community, GUI2Exe and the Namespace Diff Tool. Since I have been working on numerical optimization routines in the past, not long ago I decided to release one of my algorithms, AMPGO, to the Open Source world. It is a very powerful solver, able to outperform all the numerical algorithms in the SciPy optimize stack.

Which Python libraries are your favorite (core or 3rd party)?

I love wxPython, it enables me to create beautiful, consistent and platform-independent user interfaces, while maintaining the native appearance of widgets no matter if my GUIs are run on Windows, Linux or Mac. It’s by far the best GUI framework I have seen until now.

I work a lot with NumPy and SciPy, as our job requires heavy numerical processing, and I am always impressed by the power and speed of these two libraries. I’m also a fan of SQLAlchemy, as it allows me to store data and results in databases in a seamless (and database-independent) way.

Is there anything else you’d like to say?

Thank you for inviting me at the PyDev of the Week!

Thank you!

Previous PyDevs of the Week

January 26, 2015 01:30 PM


Caktus Consulting Group

We’re Launching a Django code school: Astro Code School

One of the best ways to grow the Django community is to have more high-quality Django developers. The good news is that we’ve seen sharply increasing demand for Django web applications. The challenge that we and many other firms face is that there’s much higher demand than there is supply: there aren’t enough high-quality Django developers. We’ve talked about this issue intensely internally and with our friends while at DjangoCon and PyCon. We decided that we can offer at least one solution: a new Django-focused code school.

We’re pleased to announce the launch of Astro Code School in Spring 2015. Astro will be the first Django code school on the East Coast. Programs include private trainings and weekend, 3-week, and 12-week full-time courses. In addition to Django, students will learn Python (of course), HTML, CSS, and JavaScript. They will come away being able to build web applications. The shorter programs will be geared towards beginners. The longer program will are for those with previous programming experience. Astro will also provide on-site, private corporate training, another area we frequently get asked about.

Astro will be a separate company under Caktus. To support Astro, we welcome Brian Russell, the new director of Astro. Brian is the former owner of Carrboro Creative Coworking, the place where Caktus got its start. In addition to being a long-term supporter of new developers, Brian is also an artist and entrepreneur. He has a special interest in increasing diversity within open source. Django itself is one of the most respectful and welcoming places for women and minorities and he’s excited to contribute.

Our first and leading instructor will be Caleb Smith, a Caktus developer since 2011. Caleb first joined Caktus as an intern, straight from his days as a public school music teacher. He continued to teach while at Caktus, supporting free and low-cost courses for women through the nonprofit Girl Develop It RDU. He’s also currently teaching an advanced web application course at the University of North Carolina’s School of Journalism and Mass Communication.

We’re building out the space for Astro currently on the first floor of our new headquarters in Downtown Durham. Astro Code School will have a dedicated 1,795 square feet of space. Construction should be complete by April.

January 26, 2015 01:15 PM