Re: [Tutor] would pickle or cpickle help?

2005-06-30 Thread Danny Yoo
> Could I use something like cpickle to store the dictionary once it is > made so I would not have to make it each time? I have never tried to > use pickle so I am bit fuzzy on what it can store and what it can't. > Also would it really buy me anything...it only takes a second or two to > make t

Re: [Tutor] A more Pythonic way to do this

2005-06-30 Thread Adam Bark
Good, good. I probably wouldn't have been able to help you if it was something so simple but that screws up your program and makes it hard to find out just what is going on. Anyway good look with anymore tidying on that you might be doing. Any chance of a copy? AdamOn 7/1/05, D. Hartley <[EMAIL PR

Re: [Tutor] Need help new to Programming

2005-06-30 Thread Kent Johnson
Jimmy wrote: > My project right now is “Write another program that reads 100 numbers > from the user and prints out the sum” Now I can get the program to do > these functions, but it won’t stop even using the break statement. Any > help or guidance would be great. Can you show us what you have

[Tutor] {Possible Spam?} Need help new to Programming

2005-06-30 Thread Jimmy
My project right now is “Write another program that reads 100 numbers from the user and prints out the sum” Now I can get the program to do these functions, but it won’t stop even using the break statement.  Any help or guidance would be great.

Re: [Tutor] html scrapeing

2005-06-30 Thread Bob Gailer
At 10:36 AM 6/26/2005, Nathan Hughes wrote: Ive been looking for way to scrape the data from a html table, but dont know even where to start, or how to do.. an example can be found here of the table ( http://www.dragon256.plus.com/timer.html ) - i'd like to extract all the data except for the del

Re: [Tutor] A more Pythonic way to do this

2005-06-30 Thread D. Hartley
. it was a paren. I was so worried that I just wasn't figuring it all out, that I had tried to write elegant code and wasnt understanding the fundamentals, and the only reason it didnt work was because I left out a paren. I actually laughed until I cried. Thanks for that. And yes, it works

Re: [Tutor] A more Pythonic way to do this

2005-06-30 Thread Brian van den Broek
D. Hartley said unto the world upon 30/06/2005 18:11: > Hey guys! > > I have a 'quest,' and at first glance this email looks long, but the > problem is probably not as complex as the length implies. Please bear > with me, if I could get some advice on this particular problem, it > would go along

Re: [Tutor] A more Pythonic way to do this

2005-06-30 Thread Adam Bark
Here's the problem --> enemyship_sprites.add(Enemy((cols*60)+20, (rows*40)+30), level)     1,2   1    2    1  0 you've put a braket after +30 which ends the Enemy call. The numbering is +1 for op

[Tutor] A more Pythonic way to do this

2005-06-30 Thread D. Hartley
Hey guys! I have a 'quest,' and at first glance this email looks long, but the problem is probably not as complex as the length implies. Please bear with me, if I could get some advice on this particular problem, it would go along way toward helping me be a better Python programmer. Some of you

[Tutor] would pickle or cpickle help?

2005-06-30 Thread Ertl, John
All, I have a text file that contains several thousand lines of space delimited text that contain a ship ID and a ship name. This file is updated every few months. I have another file that contains the ship ID and some other info but not the ship name. I have to append the ship name to the end

Re: [Tutor] Jimage reader. How to find the pixels?

2005-06-30 Thread Danny Yoo
On Thu, 30 Jun 2005, Joseph Quigley wrote: > I've been looking a lot for a mod that will automatically find the > pixels in an image but I can't find one. Do you know of one? imageop and > imghdr don't have anything like that. Thanks, Hi Joseph, You might want to try the Python Imaging Library

Re: [Tutor] HANDLING ERRORS

2005-06-30 Thread Alan G
> numbers = {} > menu_choice = 0 > print_menu() > while menu_choice != 5: > > try: > > menu_choice = input("Type in a number (1-5):") > if menu_choice == 1: > print "Telephone Numbers:" > > except ValueError: > print "Oops! That was n

Re: [Tutor] mscvrt module question

2005-06-30 Thread Alan G
>File "C:\Documents and Settings\Tom C\My Documents\Python projects - > Toms\quiz\quiz.py", line 13, in __main__ > KeyIn = getch() > NameError: name 'getch' is not defined > Have you actually imported the msvcrt module? And if so did you import kbhit and getch since you aren't prefixing t

Re: [Tutor] Jimage reader. How to find the pixels?

2005-06-30 Thread Joseph Quigley
I've been looking a lot for a mod that will automatically find the pixels in an image but I can't find one. Do you know of one? imageop and imghdr don't have anything like that. Thanks, Joe ___ Tutor maillist - Tutor@python.org http://mail.python.

[Tutor] Unix User Adminstration Scripts

2005-06-30 Thread Andrew D. Fant
I'm in the planning stages of writing a program to manage user accounts on some unix boxes that cannot be directly hooked into our central account management system at work. Obviously, the heavy lifting can be done with shell calls to the underlying commands or via direct edits of the relevant fil

[Tutor] Directory notification

2005-06-30 Thread Hugo González Monteverde
Hi all, I was writing a daemon to continuously check for changes in a directory and then process the new files, I was polling every X seconds, but I decided I should give dnotify a try in Python. Here is my test program, I just want to share it with others on the list, as it is a very nice way

Re: [Tutor] Cookielib - CookieJar objects

2005-06-30 Thread Kent Johnson
D. Hartley wrote: > This does work. However, it only ever returns me one value. For > instance, the first three are BZh. My code is: > > def urlsearch(times): > x = 12345 > count = 0 > myjar = cookielib.CookieJar() > opener = urllib2.build_opener(urllib2.HTTPCookieProcessor(myja

Re: [Tutor] html scrapeing

2005-06-30 Thread Kent Johnson
Nathan Hughes wrote: > Hi, > > Ive been looking for way to scrape the data from a html table, but dont > know even where to start, or how to do.. Take a look at Beautiful Soup: http://www.crummy.com/software/BeautifulSoup/ Kent ___ Tutor maillist -

[Tutor] wxPython shaped window

2005-06-30 Thread Adam Bark
On 6/26/05, Adam Cripps <[EMAIL PROTECTED]> wrote: On 6/25/05, Adam Bark <[EMAIL PROTECTED]> wrote:> Thanks for the info Adam I just seem to be having a problem with the panel > size it greys out nearly all the image. Ideally I would like to make the > panel transparent but I can't work out how t

Re: [Tutor] HANDLING ERRORS

2005-06-30 Thread Light
HI Move the "except ..." outside the "if...". Try this one: print "Type Control C or -1 to exit" def print_menu(): print '1. Print Phone Numbers' print '2. Add a Phone Number' print '3. Remove a Phone Number' print '4. Lookup a Phone Number' print '5. Quit' print numbers =

[Tutor] HANDLING ERRORS

2005-06-30 Thread Feziwe Mpondo
HI help mi. here's what i tried but it's not working print "Type Control C or -1 to exit" def print_menu(): print '1. Print Phone Numbers' print '2. Add a Phone Number' print '3. Remove a Phone Number' print '4. Lookup a Phone Number' print '5. Quit' print numbers = {} menu

[Tutor] mscvrt module question

2005-06-30 Thread Tom Cloyd
Executing within Komodo 3.1, running python 2.4.1, it appears that when running my source file, python knows kbhit(), but not getch(). How can this be? KeyIn = getch() File "C:\Program Files\ActiveState Komodo 3.1\dbgp\pythonlib\dbgp\client.py", line 1799, in runMain self.dbg.ru