Re: [Tutor] attribute error --Disregard

2007-07-28 Thread Sara Johnson
Disregard this post. Sorry for the added message in everyone's inbox. - Original Message From: Sara Johnson <[EMAIL PROTECTED]> To: Python Sent: Saturday, July 28, 2007 11:19:15 PM Subject: Re: [Tutor] attribute error I scrapped that other attempt. I keep hitting brick walls. Howe

Re: [Tutor] attribute error

2007-07-28 Thread Sara Johnson
I scrapped that other attempt. I keep hitting brick walls. However, is there an indentation error here? I may just be too frustrated to see it. for key in skeys: fracmiss=1.*numberMissing(z[key].values())/nsites #note decimal multiplication, 1.* outstring="%s has %4.1f%% missi

Re: [Tutor] attribute error

2007-07-28 Thread Bob Gailer
Sara Johnson wrote: > I thought 'sort()' was a function you could use as long as the dict or > key had some value. When is this not right? Please give us some context for the question. Code fragment, traceback. sort is a method of mutable sequence types (lists, ...) myList = [1, 3, 2] myList.so

[Tutor] attribute error

2007-07-28 Thread Sara Johnson
I thought 'sort()' was a function you could use as long as the dict or key had some value. When is this not right? Park yourself in front of a world of choices in alternative vehicles. Visit the Yahoo!

Re: [Tutor] ideas for college app.

2007-07-28 Thread Dick Moores
At 03:02 AM 7/28/2007, Shriphani Palakodety wrote: >Hello all, >I am looking for a few ideas for my college app. Can someone give me a >few ideas i could work on? I would like to use these to learn more of >python and to become a true expert at it. Are there any set requirements for your "college

Re: [Tutor] ideas for college app.

2007-07-28 Thread Bob Gailer
Shriphani Palakodety wrote: > Hello all, > I am looking for a few ideas for my college app. Can someone give me a > few ideas i could work on? I would like to use these to learn more of > python and to become a true expert at it. > I don't understand what you want. Probably others also don't,

Re: [Tutor] Shelve del not reducing file size

2007-07-28 Thread Eric Brunson
Andreas Kostyrka wrote: > -BEGIN PGP SIGNED MESSAGE- > Hash: SHA1 > > > > Eric Brunson wrote: > >> On Sat, July 28, 2007 4:01 am, Thorsten Kampe wrote: >> >>> * Kent Johnson (Fri, 27 Jul 2007 08:06:33 -0400) >>> >>> Barton David wrote: > *sigh* I'm

Re: [Tutor] Livewires questions

2007-07-28 Thread Luke Paireepinart
Luke Paireepinart wrote: > > > I ran the code that you had included, thank you for this. It did > produce the player and the robot on the grid, but the keyboard > commands > did not work. I wasn't entire sure why, but I thought I would let > you know. > > > Sure, sure. I'm gl

Re: [Tutor] Sum of Scores

2007-07-28 Thread Luke Paireepinart
Tiger12506 wrote: Well, I was trying to emphasize that it was, for pretty much all intents and purposes, infinite. >>> Nope-nope-nope you're wrong :-)~ >>> >> The way I understood the 'period' of the random function was that after x >> calls to the function, yo

Re: [Tutor] comparing lists, __lt__ and __gt__

2007-07-28 Thread Alan Gauld
"Sara Johnson" <[EMAIL PROTECTED]> wrote > Thanks Alan. That said, any idea what it means in this context? > > for key in skeys: >fracmiss=1.*numberMissing(z[key].values())/nsites #note > decimal multiplication, 1.* >outstring="%s has %4.1f%% missing" % (key,100*fracmiss) >

Re: [Tutor] comparing lists, __lt__ and __gt__

2007-07-28 Thread Sara Johnson
Thanks Alan. That said, any idea what it means in this context? for key in skeys: fracmiss=1.*numberMissing(z[key].values())/nsites #note decimal multiplication, 1.* outstring="%s has %4.1f%% missing" % (key,100*fracmiss) if fracmiss >>0 - Original Message Fr

Re: [Tutor] Shelve del not reducing file size

2007-07-28 Thread Alan Gauld
"Eric Brunson" <[EMAIL PROTECTED]> wrote > On Sat, July 28, 2007 4:01 am, Thorsten Kampe wrote: >>> In what way is it Python's fault that the dbm database doesn't >>> reclaim >>> disk space? >> >> It's actually how most databases work. Even a simple Outlook pst >> file >> (which is a database, t

Re: [Tutor] comparing lists, __lt__ and __gt__

2007-07-28 Thread Alan Gauld
"Sara Johnson" <[EMAIL PROTECTED]> wrote > What if there is a '<<' or '>>'? > Does that just mean the same thing (maybe a little over emphasized.. > ;) The double chevron operator is for bit-shifting its not a camparison operation. So no operator override function exists. > I thought I saw th

Re: [Tutor] Shelve del not reducing file size

2007-07-28 Thread Andreas Kostyrka
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Eric Brunson wrote: > On Sat, July 28, 2007 4:01 am, Thorsten Kampe wrote: >> * Kent Johnson (Fri, 27 Jul 2007 08:06:33 -0400) >> >>> Barton David wrote: >>> *sigh* I'm really going off Python. >>> In what way is it Python's fault that the

Re: [Tutor] comparing lists, __lt__ and __gt__

2007-07-28 Thread Sara Johnson
First off, Kent, thanks for posting that! I know it's in the Python library but it does help to have a bookmark for things I know I'll need pretty soon. Second... What if there is a '<<' or '>>'? Does that just mean the same thing (maybe a little over emphasized.. ;) I thought I saw this w

Re: [Tutor] Shelve del not reducing file size

2007-07-28 Thread Eric Brunson
On Sat, July 28, 2007 4:01 am, Thorsten Kampe wrote: > * Kent Johnson (Fri, 27 Jul 2007 08:06:33 -0400) > >> Barton David wrote: >> >>> *sigh* I'm really going off Python. >>> >> >> In what way is it Python's fault that the dbm database doesn't reclaim >> disk space? > > It's actually how most data

Re: [Tutor] build a really simple "json" api from a db

2007-07-28 Thread Alan Gauld
"Picio" <[EMAIL PROTECTED]> wrote > Hello, I'd like to know the necessary steps to build a json api for > two table on my db. Since you seem to be using Django are you sure that isn't built in? I use Turbo Gears and JSON is a standard feature turned on by an option in a method. Django is quite

[Tutor] build a really simple "json" api from a db

2007-07-28 Thread Picio
Hello, I'd like to know the necessary steps to build a json api for two table on my db. The design will be: an ajax app asking for data to my server, that fetches those data from a db then build the answer in json. Ajax n the client will then use json data to do some staff. I'd like to build this A

Re: [Tutor] Shelve del not reducing file size

2007-07-28 Thread Thorsten Kampe
* Kent Johnson (Fri, 27 Jul 2007 08:06:33 -0400) > Barton David wrote: > > *sigh* I'm really going off Python. > > In what way is it Python's fault that the dbm database doesn't reclaim > disk space? It's actually how most databases work. Even a simple Outlook pst file (which is a database, too

Re: [Tutor] os.path.exists(path) returns false when the pathactually exists!

2007-07-28 Thread Thorsten Kampe
* Tiger12506 (Sat, 28 Jul 2007 10:33:36 -0500) > > So the better question is, does is this file a broken symbolic link or > > can os.stat() be executed on it? > > > > How do I find if it is a broken symbolic link in Windows 2000 ? > > > > os.stat(path) returns an OSError saying that there is no suc

Re: [Tutor] Shelve del not reducing file size

2007-07-28 Thread Eric Brunson
Alan Gauld wrote: > "Andreas Kostyrka" <[EMAIL PROTECTED]> wrote > > >>> a lot to build the Tacoma Narrows bridge... Similarly you don't >>> need >>> much math to build a GUI friont end to a database, but you need >>> >> I would question even that one can write a good GUI frontend to a >

Re: [Tutor] Sum of Scores

2007-07-28 Thread Tiger12506
>> > Well, I was trying to emphasize that it was, for pretty much all >> > intents >> > and purposes, infinite. >> >> Nope-nope-nope you're wrong :-)~ > > > The way I understood the 'period' of the random function was that after x > calls to the function, you would start getting the same pattern

Re: [Tutor] putting python to use

2007-07-28 Thread Tiger12506
>> >> /usr/sbin/advxrun2.0 # starts server then >> open (path) apache.config for input ? >> > > I don't really understand what you want to do. If you want to write a > script that runs other programs, look at os.system() > http://docs.python.org/lib/os-process.html#l2h-2761 > > What do you mean b

Re: [Tutor] os.path.exists(path) returns false when the pathactually exists!

2007-07-28 Thread Tiger12506
> Adam wrote: > >>From the library documentation: > Return True if path refers to an existing path. Returns False for > broken symbolic links. On some platforms, this function may return > False if permission is not granted to execute os.stat() on the > requested file, even if the path physically e

Re: [Tutor] Shelve del not reducing file size

2007-07-28 Thread Alan Gauld
"Andreas Kostyrka" <[EMAIL PROTECTED]> wrote >> a lot to build the Tacoma Narrows bridge... Similarly you don't >> need >> much math to build a GUI friont end to a database, but you need > > I would question even that one can write a good GUI frontend to a > database without the theory behind it.

Re: [Tutor] putting python to use

2007-07-28 Thread Kent Johnson
chris harvey wrote: > Hi, > I am very very new to python language. if this is to > simple im sorry. I have had linux mandrake for 2 weeks > now and i have been learning. > I got my apache server running to find it has no GUI. > I was disapointed till i remembered i was learning > python. > I wond

Re: [Tutor] Shelve del not reducing file size

2007-07-28 Thread Kent Johnson
Andreas Kostyrka wrote: > Believe me, the Python developers are sure listening. Only that > "cleaning up the mess" has associated costs, that are usually not > acceptable. If it comes to "not breaking existing programs" or "cleaning > up the stdlib so it's nicer", "not breaking existing programs"

Re: [Tutor] Sum of Scores

2007-07-28 Thread Luke Paireepinart
On 7/27/07, Tiger12506 <[EMAIL PROTECTED]> wrote: > > Hmmm... interesting tie to another post... > > >>> x = timeit.Timer('random.random()','import random') > >>> x.timeit(300) > 1.0161026052194018 > >>> y = timeit.Timer('random()','from random import random') > >>> y.timeit(460) > 1.000430

[Tutor] ideas for college app.

2007-07-28 Thread Shriphani Palakodety
Hello all, I am looking for a few ideas for my college app. Can someone give me a few ideas i could work on? I would like to use these to learn more of python and to become a true expert at it. ___ Tutor maillist - Tutor@python.org http://mail.python.

Re: [Tutor] Shelve del not reducing file size

2007-07-28 Thread Andreas Kostyrka
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Barton David wrote: > Eric Brunson wrote: >> You seem like a smart guy that's having a bad day, so I'm cutting you >> slack. > > Thanks Eric. Yes I did indeed have a bad day (and it got much much worse), > and this is most definitely a case of a ba

Re: [Tutor] os.path.exists(path) returns false when the path actually exists!

2007-07-28 Thread Hugo González Monteverde
Iyer wrote: > > Adam wrote: > > From the library documentation: > Return True if path refers to an existing path. Returns False for > broken symbolic links. On some platforms, this function may return > False if permission is not granted to execute os.stat() on the > requ