Re: Best way to handle exceptions with try/finally

2006-05-24 Thread Enigma Curry
We used to have a try..except..finally syntax in Python. It was taken out a while ago for reasons unknown to me. The good news is that it is back in Python 2.5. I haven't tested it, but Guido said so himself: http://video.google.com/videoplay?docid=60331183357868340 -- http://mail.python.org/mai

Re: How's python's web scraping capabilities (vs LWP) ...

2006-04-08 Thread Enigma Curry
I don't know much about LWP.. but Beautiful Soup is grand! http://www.crummy.com/software/BeautifulSoup/ Ryan McGuire -- http://mail.python.org/mailman/listinfo/python-list

Re: Python based 'Toaster' animation like Gaim or MSN Messenger?

2006-04-08 Thread Enigma Curry
Ok, cool! There's one for wxPython called ToasterBox ( http://wiki.wxpython.org/index.cgi/ToasterBox ) I'm more familiar with pyGTK.. so if anyone knows one based on pyGTK, please let me know! :) Ryan McGuire -- http://mail.python.org/mailman/listinfo/python-list

Python based 'Toaster' animation like Gaim or MSN Messenger?

2006-04-08 Thread Enigma Curry
I'm looking for something that can display a pop-up "toaster" like animation like Gaim or MSN messenger does to notify of incoming messages. There's JToaster ( http://jtoaster.sourceforge.net/ ) for Java... anything similar for Python? Thanks! Ryan McGuire -- http://mail.python.org/mailman/lis

Re: Matplotlib: Histogram with bars inside grid lines...how??

2006-03-29 Thread Enigma Curry
pylab.xlim(0.5,6.5) should be: pylab.xlim(min_x-(bar_width/2),max_x+(bar_width/2)) -- http://mail.python.org/mailman/listinfo/python-list

Re: Matplotlib: Histogram with bars inside grid lines...how??

2006-03-29 Thread Enigma Curry
Thank you John. Your explanation helped a lot! In case it helps anyone else in the future, here is my code for *exactly* what I was after: import pylab def ryan_hist(data, bar_width, min_x, max_x): """ Create a frequency histogram over a continuous interval min_x = the low end of th

Re: Matplotlib: Histogram with bars inside grid lines...how??

2006-03-29 Thread Enigma Curry
Two things: 1) I now see where width is defined in the hist() documentation... I was expecting it to be in the definition up at the top, but instead the definition has **kwords.. not very helpful. 2) I noticed in my original historgram, that the y scale was not the same as the x scale.. so I upda

Matplotlib: Histogram with bars inside grid lines...how??

2006-03-29 Thread Enigma Curry
I'm playing around with matplotlib for the first time. I'm trying to make a very simple histogram of values 1-6 and how many times they occur in a sequence. However, after about an hour of searching I cannot make the histogram stay within the bounds of the grid lines. Here is my example: pylab.gr

Re: a hobbyist's dilemma

2006-03-29 Thread Enigma Curry
I would second the vote for pythonchallenge. It's what taught me Python. The amazing thing about the python challenge is by the time your done with it, you've gotten through a very large and diverse sampling of the python docs. It really gave me a good understanding of all the things that Python c

Re: years later DeprecationWarning

2006-03-22 Thread Enigma Curry
> (That long-gone guy is actually me, according to the notes in the program. > However those brain cells are long gone now, so it might as well not be me.) I had a great long laugh with this bit. I guess it's because I can relate so well :) -- http://mail.python.org/mailman/listinfo/python-list

Re: Spidering Hacks for Python, not Perl

2006-03-20 Thread Enigma Curry
I've been looking for similar stuff recently. I haven't found much, but this is the list of links I've come across so far: Harvest Man - http://harvestman.freezope.org/ Mechanize - http://wwwsearch.sourceforge.net/mechanize/ Beautiful Soup - http://www.crummy.com/software/BeautifulSoup/ (Neither B

Re: Threads: does Thread.start() atomically set Thread.__started ?

2006-03-15 Thread Enigma Curry
Peter, Thanks for the reference! I don't know why but for some reason I thought that I would be wading through a bunch of C code (which I know very little of). I haven't found my answer yet but this threading.py does look fairly straightforward. Thanks! -- http://mail.python.org/mailman/listinf

Threads: does Thread.start() atomically set Thread.__started ?

2006-03-14 Thread Enigma Curry
Can some kind person please further my education on Threads? When I create a thread called "t" and I do a "t.start()" am I guaranteed that "t.isAlive()" will return True as long as the thread hasn't already completed? Put another way, does "t.start()" ever return before t.__started is set to True?

Re: capturing stdout from lynx..

2006-03-10 Thread Enigma Curry
Does this do what you want? import os filename = "test.html" cmd = os.popen("lynx -dump %s" % filename) output = cmd.read() cmd.close() print output -- http://mail.python.org/mailman/listinfo/python-list

Re: beautiful soup library question

2006-03-10 Thread Enigma Curry
Here's how I print each line after the 's: import BeautifulSoup as Soup page=open("test.html").read() soup=Soup.BeautifulSoup(page) for br in soup.fetch('br'): print br.next -- http://mail.python.org/mailman/listinfo/python-list

Re: In need of a virtual filesystem / archive

2006-02-21 Thread Enigma Curry
Thanks for all the suggestions! I realized a few minutes after I posted that a database would work.. I just wasn't in that "mode" of thinking when I posted. PyTables also looks very interesting, especially because apparently I can read a file in the archive like a normal python file, ie one line

In need of a virtual filesystem / archive

2006-02-20 Thread Enigma Curry
I need to store a large number of files in an archive. From Python, I need to be able to create an archive, put files into it, modify files that are already in it, and delete files already in it. The easy solution would be to use a zip file or a tar file. Python has good standard modules for acces

Re: Language Semantics: @ symbol??

2006-01-29 Thread Enigma Curry
Awesome! Thanks. -- http://mail.python.org/mailman/listinfo/python-list

Language Semantics: @ symbol??

2006-01-29 Thread Enigma Curry
Sorry, for the noob question, but I haven't been able to find documentation on this matter. I've been looking for documentation that describes what the @function() syntax is all about. I've seen this on a few pages, for instance: http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/307871 an