sponsors: charming collections

PyOhio 2010 Plans

PyOhio is this weekend! If you are thinking about going you should stop thinking and register. You’ll have a good time.

I’ve been asked several times over the last few days about what to expect and if it is worth going. It’s definitely worth your time. You can’t beat a free, high quality conference. (You may need to to pay ~$100 or so for a hotel and spring for some food if you are too far away to drive.) What to expect is a bit harder to answer.

Much like peace or love everyone experiences conferences in their own way. If you are mostly into sessions then you’ll enjoy our two tracks of talks. If you are a Python newbie we have a track for beginners. If you want to participate in active discussions you can attend an open space or run one of your own. Want to code? There are a few sprints scheduled for Saturday evening and I believe the few days following the conference.

I’m going to try to do more open spaces/socializing this year. There are a few talks I’d like to attend, but I don’t think that’s how I’ll be most productive. The From Python Import Podcast crew will be around on Saturday and we plan on doing some interviews. That should be a lot of fun.

If you see me walking around please stop me and introduce yourself. I’m very interested in hearing about the cool things you are doing in Python. I’ll see you in a few days.

Share and Enjoy: These icons link to social bookmarking sites where readers can share and discover new web pages.
  • Digg
  • del.icio.us
  • Reddit
  • Technorati

PyOhio 2010 Registration Open!

From the official PyOhio website:

PyOhio is an annual conference for Python programmers in and around Ohio. PyOhio 2010, the third annual conference, will take place July 31 - August 1, 2010 at Ohio State University’s Ohio Union.

Register now!

Share and Enjoy: These icons link to social bookmarking sites where readers can share and discover new web pages.
  • Digg
  • del.icio.us
  • Reddit
  • Technorati

FPIP Episode 001 Has Been Released

Get it while it’s hot! It was a lot of fun to make and I’m looking forward to really making ut a success. Mad props go out to Chris Miller for carrying the podcast newbies.

Please subscribe, listen and enjoy. We have some great ideas for upcoming shows that you won’t want to miss.

Share and Enjoy: These icons link to social bookmarking sites where readers can share and discover new web pages.
  • Digg
  • del.icio.us
  • Reddit
  • Technorati

From Python Import Podcast

The first podcast in the From Python Import Podcast series has been recorded. Chris Miller did a really good job of explaining the concept in a blog post yesterday. In my mind Chris, Mike Crute and I will start peeling the onion of the Python community. Stay tuned, I think you’ll enjoy it.

Share and Enjoy: These icons link to social bookmarking sites where readers can share and discover new web pages.
  • Digg
  • del.icio.us
  • Reddit
  • Technorati

Setting Gmail As The Preferred Mail Reader In Gnome

A Google search turns up lots of dead ends. Some are pretty good, but most are completely useless. I tried a couple of the configuration variations suggested in the article and its comments and didn’t have much luck.

It turns out that it’s actually easy. Just follow these simple steps:

  1. Download Gnome Gmail
  2. Install it! I used the .deb because I run Ubuntu.
  3. Go to System -> Preferences -> Preferred Applications
  4. Select Gmail in the Mail Reader drop down
Share and Enjoy: These icons link to social bookmarking sites where readers can share and discover new web pages.
  • Digg
  • del.icio.us
  • Reddit
  • Technorati

Getting Branch Coverage In Nose

Just a few days ago Ned Batchelder announced experimental branch coverage support in coverage.py. I have been waiting a long time for this. I had a few false starts myself so I know how much time Ned put into it. Thanks Ned!

I changed the coverage plugin included with nose to interact better with coverage.py.

You can find my changes here: http://code.google.com/r/dstanekcom-python-nose/source/list.

Share and Enjoy: These icons link to social bookmarking sites where readers can share and discover new web pages.
  • Digg
  • del.icio.us
  • Reddit
  • Technorati

Hacking On A super Alternative

Python’s super built-in has always bugged me. I’m talking about something much more superficial than James Knight’s thoughts on it being harmful. I’m talking out its signature. I dislike the fact that it requires the current class and instance to be passed in. For example:

class SubClass(BaseClass):
def method(self, arg, this=that):
    super(SubClass, self).method(arg, this)

To avoid doing an real work I hacked together an alternative implementation. I was able to get something that appears to work correctly, but I can’t guarantee it. With my new super the code would look like:

from better_super import super

class SubClass(BaseClass):
def method(self, arg, this=that):
    super().method(arg, this)

This should not be used in any real production code. There are likely bugs lurking in corner cases and strange failure modes. It’s also four times slower than the built-in super.

It was still interesting to explore the implementation and I learned a bit about frames in the process.

My hacky implementation:

better_super.py

import inspect as _inspect from __builtin__ import super as _builtin_super def _what_class_am_i_in(mro, func_name, func_code): for c in mro: if getattr(c, func_name).func_code is func_code: return c return None def super(): frame = _inspect.currentframe().f_back arg_info = _inspect.getargvalues(frame) self = arg_info[3][arg_info[0][0]] mro = _inspect.getmro(self.__class__) method_name = frame.f_code.co_name code_obj = frame.f_code cls = _what_class_am_i_in(mro, method_name, code_obj) return _builtin_super(cls, self)

I’d love to hear about other ways to implement this. Have you tried yet?

Share and Enjoy: These icons link to social bookmarking sites where readers can share and discover new web pages.
  • Digg
  • del.icio.us
  • Reddit
  • Technorati

PyOhio 2009 Call For Proposals

The PyOhio Call for Proposals has been issued!

PyOhio

PyOhio 2009 takes place July 25-26, 2009 at the Ohio State University in Columbus, Ohio. Much like a mini-PyCon, it includes scheduled talks, tutorials, Lightning Talks, Open Spaces, and room for your own unique ideas. If you can make it to Ohio this summer, please consider participating.


PyOhio 2009, the second annual Python programming mini-conference for Ohio and surrounding areas, will take place Saturday-Sunday, July 25-26, 2009 at the Ohio State University in Columbus, Ohio. A variety of activities are planned, including tutorials, scheduled talks, Lightning Talks, and Open Spaces.

PyOhio invites all interested people to submit proposals for scheduled talks and tutorials. PyOhio will accept abstracts on any topics of interest to Python programmers.

Standard presentations are expected to last 40 minutes with a 10 minute question-and-answer period. Other talk formats will also be considered, however; please indicate your preferred format in your proposal. Hands-on tutorial sessions are also welcomed. Tutorial instructors should indicate the expected length

PyOhio is especially interested in hosting a Beginners’ Track for those new to Python or new to programming in general. If your proposal would be suitable for inclusion in the Beginners’ Track, please indicate so. Organizers will work with speakers and instructors in the Beginners’ Track to help them coordinate their talks/tutorials into a smooth, coherent learning curve for new Python users.

All proposals should include abstracts no longer than 500 words in length. Abstracts must include the title, summary of the presentation, the expertise level targeted, and a brief description of the area of Python programming it relates to.

All proposals should be emailed to cfp@pyohio.org for review. Please submit proposals by May 15, 2009. Accepted speakers will be notified by June 1.

You can read more about the conference at http://pyohio.org

If you have questions about proposals, please email cfp@pyohio.org. You can also contact the PyOhio organizers at pyohio-organizers@python.org.

Share and Enjoy: These icons link to social bookmarking sites where readers can share and discover new web pages.
  • Digg
  • del.icio.us
  • Reddit
  • Technorati

I’m Planning a PyCon 2010 Talk

During Andrew Kuchlings’s talk on How to Give a Python Talk he mentioned the top rated PyCon talks over the years. I was extremely surprised to see the talk Mike Pirnat and I gave in 2006 on the list. The video for Python Can Survive In The Enterprise is available here if you missed it.

I’m now motivated to do a talk next year. I have a large number of commitments so I’m starting the preparation early.

Possible Topics:

  1. Python Dependency Injection and snake-guice
  2. Virtual Hosting with WSGI - applications on multiple domains in the same app server instance

All feedback is welcome. I’m open to talk suggestions. Is there something that I do or work on that may make an interesting talk?

Share and Enjoy: These icons link to social bookmarking sites where readers can share and discover new web pages.
  • Digg
  • del.icio.us
  • Reddit
  • Technorati

Simple Random Number Generator For #codemash

Each #CodeMash attendee’s badge had a unique integer that was used in a raffle to give away prizes. Unfortunately random.org was used to pick the set of lucky winners.

Unsurprisingly the sequences of random numbers generated by random.org contained duplicates. Several numbers like 123 were called 3 or 4 times. I would have liked each number to be called only once. Python to the rescue.

To get a randomized list of all attendees:

import random, sys
all_attendees = range(550)
random.shuffle(all_attendees)

When run this script will print a random number each time you press enter until the range is exhausted. CTRL-D will let you exit early if all the prizes are gone. The range is 0-549.

import os
import random
all_attendees = range(550)
random.shuffle(all_attendees)
for attendee in all_attendees:
    try:
        raw_input()
    except EOFError:
        os.exit(0)
    print attendee
print '\nAll attendee numbers have been exhausted.'

Replace 550 with the actual number of attendees.

Share and Enjoy: These icons link to social bookmarking sites where readers can share and discover new web pages.
  • Digg
  • del.icio.us
  • Reddit
  • Technorati

Next Page →