A guy looking ridiculous by doing a fashionable posing with a mouse, slinging the cord over his shoulders.
[personal profile] foxfirefey
[personal profile] skud linked to a video tutorial by [twitter.com profile] theleadingzero about Audio Processing in Python, seemed like a nifty thing to share about here!
A guy looking ridiculous by doing a fashionable posing with a mouse, slinging the cord over his shoulders.
[personal profile] foxfirefey
Don't know if this could be useful to anyone else, but I just wrote a wee script that generates the HTML for images in a directory on my web server, to make it easier to post about them to my journal:

import Image, sys

if len(sys.argv) < 3:
    print "Usage: %s [baseurl] [filename] [filename] ..." % sys.argv[0]

# put this in front of each image file name
baseurl = sys.argv[1]

# cycle through all image names given on the command line
for imagefile in sys.argv[2:]:

    try:
        i = Image.open(imagefile)
        ( width, height ) = i.size
        print '<img src="%s/%s" width="%d" height="%d" alt="" />' \
          % ( baseurl, imagefile, width, height )
    except IOError:
        print "Could not process %s" % imagefile


Example of running it: )
A guy looking ridiculous by doing a fashionable posing with a mouse, slinging the cord over his shoulders.
[personal profile] foxfirefey

Apparently, Python has a .vimrc file (which specifies how the command-line vim editor works) specifically for coding in the recommended Python style:

http://svn.python.org/projects/python/trunk/Misc/Vim/vimrc

I put it as .vimrc-python and included it in my main .vimrc like so:

source ~/.vimrc-python
Smiley faces are born through factorized mechanical torture.
[personal profile] foxfirefey
Most of the time when I want to quit using you, I do something like this:

>>> exit
Use exit() or Ctrl-D (i.e. EOF) to exit


I am not sure why, if you know enough about what I want to give me a warning message about what I should Properly Do, you couldn't just exit and save me the headdesking trouble!

Other than that, I love you, so I am hoping you have a Really Good reason for this that I just don't know about.

pycon

Sep. 17th, 2009 02:29 pm
dripping blood-red hand graffiti on an off-white wall, with a heart in the center of the palm.
[personal profile] catechism
Anyone going to Pycon 2010 (in Atlanta)? Submitting a talk? Proposals are due in less than two weeks.

I can't go this year, unfortunately, but I've been to two previously and have had a good time.
A close up of my eye, upside down.
[personal profile] foxfirefey
I kind of wish I had this article when I was first embarking on Python, but it's still useful to me even later in the game:

Code Like a Pythonista: Idiomatic Python
A close up of my eye, upside down.
[personal profile] foxfirefey
Makes me love Python. I needed an class for a test suite for the DWMinion module I'm making to make it easy to create DWAccount objects on the fly. I figured out that I could do this by subclassing the dict class.

Code here )
XKCD comic: "You're flying! How" "Python!"
[personal profile] yvi
I love XKCD

I especially love http://xkcd.com/353/

So I made three icons, which you are free to use.

and

And animated version of that comic might be even better, maybe I'll do that later.

roll call

Aug. 12th, 2009 04:58 pm
gray apple logo on a background that fades from red to gray (top to bottom). red text reads 'catechism' at the bottom.
[personal profile] catechism
Hey, everyone. I just posted a roll call for women in python over here, because I'm curious whether there just aren't a lot of women using python, or if the ones who are are just pretty quiet about it, and not very involved with the larger python community. I think those are both important issues, but they're very different ones.

Could you help me spread the word? And, of course, raise your hand if you're a woman! Thanks in advance.
A close up of my eye, upside down.
[personal profile] foxfirefey
If you're interested in doing web development in Python, their wiki has a list of frameworks.

The Python web framework I've been developing in lately called Django, and I just made a community for it at [community profile] django_dev.