Re: [Tutor] Sorting of files based on filesize

2005-04-11 Thread C Smith
--request for a method of sorting disk files based on size so as to fill backup disks-- You may want to check out the karp.py routine posted at http://aspn.activestate.com/ASPN/Mail/Message/python-Tutor/749797 Right now it is coded to split N numbers into 2 groups that have sums as nearly identi

Re: [Tutor] Cell Bio Newbie Here

2005-04-11 Thread Jacob S.
Ok, it's a logic error in the while loop. Starting at the beginning: you can't compare the value of "password" until the user inputs the value, which is why it's requiring you to put password = "foobar" at the top. Otherwise, password has no value, and as far as the interpreter is concerned, it

Re: [Tutor] Using python with MS Excel (Newbie)

2005-04-11 Thread Liam Clarke
PS Check out the sample chapter http://www.oreilly.com/catalog/pythonwin32/chapter/ch12.htmlOn Apr 12, 2005 11:42 AM, Liam Clarke <[EMAIL PROTECTED]> wrote:Hi Andre, The gent responsible for win32com Mark Hammond wrote a book about it, but there's quite a useful help file included with the Win3

Re: [Tutor] Using python with MS Excel (Newbie)

2005-04-11 Thread Liam Clarke
Hi Andre, The gent responsible for win32com Mark Hammond wrote a book about it, but there's quite a useful help file included with the Win32all package. http://www.oreilly.com/catalog/pythonwin32/ I do recommend the book, however. Also I recommend The Quick Python book, it has a nice run-down

Re: [Tutor] Cell Bio Newbie Here

2005-04-11 Thread Brian van den Broek
Alberto Troiano said unto the world upon 2005-04-11 17:43: Hi Brian Thanks for correcting me about the variable and reserved word differences (just for the record the problem is that my english is not so good, you see I'm from Bolivia so pardon my francôis :P) Hi Alberto, I wouldn't have known y

Re: [Tutor] Sorting of files based on filesize

2005-04-11 Thread jfouhy
Quoting Kent Johnson <[EMAIL PROTECTED]>: > This is a hard problem. It is a version of the "0-1 knapsack problem" - > googling for that might give > you some ideas. > > Hi > > Some of my harddrives are getting full and i would like to burn the files > > to > > some cheep DVD's. Filesizes range

Re: [Tutor] Cell Bio Newbie Here

2005-04-11 Thread Alberto Troiano
Sorry In the option 2 in the last IF clause there is a missing = it should be if password == "unicorn" and not if password="unicorn" Regards Alberto   Gaucho>From: Brian van den Broek <[EMAIL PROTECTED]> >To: Alberto Troiano <[EMAIL PROTECTED]> >CC: [EMAIL PROTECTED], tutor@python.org >Subject: Re

Re: [Tutor] Cell Bio Newbie Here

2005-04-11 Thread Alberto Troiano
Hi Brian Thanks for correcting me about the variable and reserved word differences (just for the record the problem is that my english is not so good, you see I'm from Bolivia so pardon my francôis :P) About the code I posted let me stand for it because it sure works like a charm. I tested and the

Re: [Tutor] str.split and quotes

2005-04-11 Thread Alberto Troiano
Gotcha!! I'll try it with my app and let you know how it went Thanks Alberto  Gaucho>From: Kent Johnson <[EMAIL PROTECTED]> >CC: tutor@python.org >Subject: Re: [Tutor] str.split and quotes >Date: Mon, 11 Apr 2005 16:55:22 -0400 > >Alberto Troiano wrote: >>Thanks Kent but now I need you to explain

Re: [Tutor] str.split and quotes

2005-04-11 Thread Kent Johnson
Alberto Troiano wrote: Thanks Kent but now I need you to explain me the code :( That code won't work for you. It is for timing how long it takes to do something, not for generating repeated events. To give you a graphic example how can make this function to run every 5 seconds def foo(): pr

Re: [Tutor] Cell Bio Newbie Here

2005-04-11 Thread Jay Loden
Ok, it's a logic error in the while loop. Starting at the beginning: you can't compare the value of "password" until the user inputs the value, which is why it's requiring you to put password = "foobar" at the top. Otherwise, password has no value, and as far as the interpreter is concerned, i

Re: [Tutor] Cell Bio Newbie Here

2005-04-11 Thread Brian van den Broek
Alberto Troiano said unto the world upon 2005-04-11 16:09: Hey Gary password="foobar" ### the variable password has to be here because you are referiencing before the assignment inside the while sentence. You can also set it to password="" and still will work because you have to tell (in this

Re: [Tutor] str.split and quotes

2005-04-11 Thread Alberto Troiano
Hey Kristian, thanks for the reply The problem to use sleep is that all widgets gets locked up and they doesn't refresh themselves I just made that example so anyone can explain the code Kent posted earlier In my real application is a Tkinter GUI so I should not use sleep Thanks anyway Regards Albe

[Tutor] Re: Sorting of files based on filesize

2005-04-11 Thread Andrei
Klas Marteleur telia.com> writes: > Some of my harddrives are getting full and i would like to burn the files to > some cheep DVD's. Filesizes range from lets say 1Mb to 1Gb. > > Ofcourse i would like to optimize the size of each DVD to be as close to > 4.7Gb > as possible (to save this chee

RE: [Tutor] Cell Bio Newbie Here

2005-04-11 Thread Alberto Troiano
Hey Gary password="foobar" ### the variable password has to be here because you are referiencing before the assignment inside the while sentence. You can also set it to password="" and still will work because you have to tell (in this example) that password is a reserved word(variable) ###

Re: [Tutor] Cell Bio Newbie Here

2005-04-11 Thread Brian van den Broek
[EMAIL PROTECTED] said unto the world upon 2005-04-11 14:54: Hey all, Sorry for the bother, thanks for the help. I'm trying to write a password guessing program to keep track of how many times the user has entered the password wrong. If it is more than 3 times, print ``That must have been complicat

RE: [Tutor] Cell Bio Newbie Here

2005-04-11 Thread Ryan Davis
Make a flowchart, by hand, on paper of what this program does. That should help explain the why. Basically, after 3 attempts, your "while" loop becomes an infinte loop. Once you are over the count, the user is never prompted for another password, so the password remains not equal to "unicorn"

Re: [Tutor] Cell Bio Newbie Here

2005-04-11 Thread Liam Clarke
Hi Gary, In a while loop, you could looping until the while condition is no longer true. So your one - while password != "unicorn" So while password isn't unicorn, your condition is True, so your while loop will keep looping until the password equals 'unicorn' After your 3rd mistake, the if

[Tutor] Cell Bio Newbie Here

2005-04-11 Thread glaevsky
Hey all, Sorry for the bother, thanks for the help. I'm trying to write a password guessing program to keep track of how many times the user has entered the password wrong. If it is more than 3 times, print ``That must have been complicated.'' Following is what I got. If I type "unicorn" it goes s

[Tutor] Using python with MS Excel (Newbie)

2005-04-11 Thread Andre Thompson
Hi All, I am trying to create a couple of python programs that creates and modifies MS Excel docs. I have been searching the web and have found some interesting pieces of information and programs but i need something more complete. Is the any documentation available explaning all the options avai

Re: [Tutor] UselessPython 2.0

2005-04-11 Thread Michael Janssen
On Apr 11, 2005 7:30 PM, Michael Janssen <[EMAIL PROTECTED]> wrote: > [what's bad about non-alphabetic characters?] I found it out for myself. To quote from Dick's post: "A man, a plan, a canal, Panama!" Seems like palindromes are allowed not to reflect whitespace and punctuation (an how could

Re: [Tutor] UselessPython 2.0

2005-04-11 Thread Michael Janssen
On Apr 10, 2005 7:18 AM, Dick Moores <[EMAIL PROTECTED]> wrote: > I'm a newbie, but would this qualify as a contribution to UselessPython 2.0? Hello Dick, don't be shy, or do you suspect it might be too usefull? ;-) I found it funny, so it must be good enough. here my remarks: > def makeString

Re: [Tutor] Sorting of files based on filesize

2005-04-11 Thread Kent Johnson
This is a hard problem. It is a version of the "0-1 knapsack problem" - googling for that might give you some ideas. Kent Klas Marteleur wrote: Hi Some of my harddrives are getting full and i would like to burn the files to some cheep DVD's. Filesizes range from lets say 1Mb to 1Gb. Ofcourse i

Re: [Tutor] problems with doctest: apparent interferance between tests (LONG)

2005-04-11 Thread Brian van den Broek
Rich Krauter said unto the world upon 2005-04-10 20:53: Brian van den Broek wrote: [text and code snipped] FWIW, I ran your code using python 2.3.4 on linux with the following modifications, and it worked fine (no failing tests out of 9): Hi Rich, Kent, and all, thanks for these additional datapo

Re: [Tutor] str.split and quotes

2005-04-11 Thread Kristian Zoerhoff
On Apr 11, 2005 11:03 AM, Kristian Zoerhoff <[EMAIL PROTECTED]> wrote: > while true: > foo() > time.sleep(5) Err, make that while True: Note to self: test before posting. -- Kristian kristian.zoerhoff(AT)gmail.com zoerhoff(AT)freeshell.org _

[Tutor] Sorting of files based on filesize

2005-04-11 Thread Klas Marteleur
Hi Some of my harddrives are getting full and i would like to burn the files to some cheep DVD's. Filesizes range from lets say 1Mb to 1Gb. Ofcourse i would like to optimize the size of each DVD to be as close to 4.7Gb as possible (to save this cheep media :) ). There are plenty of software th

Re: [Tutor] str.split and quotes

2005-04-11 Thread Kristian Zoerhoff
On Apr 11, 2005 11:00 AM, Alberto Troiano <[EMAIL PROTECTED]> wrote: > > To give you a graphic example how can make this function to run every 5 > seconds > > def foo(): > > print "Hello world!" > I'm not Kent, but I play him on TV ;-) import time def foo(): print "Hello world!"

Re: [Tutor] str.split and quotes

2005-04-11 Thread Alberto Troiano
Thanks Kent but now I need you to explain me the code :( To give you a graphic example how can make this function to run every 5 seconds def foo():     print "Hello world!" Thanks in advanced  Alberto>From: Kent Johnson <[EMAIL PROTECTED]> >To: Alberto Troiano <[EMAIL PROTECTED]> >Subject: Re: [Tut

[Tutor] Re: [Python-Help] Support with Image

2005-04-11 Thread Alberto Troiano
Thanks for the reply I read first the one Danny sent me. I'll try the code and let you know how it went About the overwhelming of the machine, is a Dedicated Server so I don't think that would happen. The person in charge of the project told me that he needed a daemon to run under Linux to store in

[Tutor] Re: [Python-Help] Support with Image

2005-04-11 Thread Alberto Troiano
Sorry, Copy Paste error I did that cursor.execute("insert into image values('',%s)",outfile.getvalue()) My question now is where should I have to retrieve the database value to show the image? And another question yet: I'm making this application to run as a daemon under Linux (the linux part

Re: [Tutor] Re: Class - superclass

2005-04-11 Thread Bernard Lebel
Thanks a lot, now it's clear. Bernard On Apr 8, 2005 3:48 PM, Andrei <[EMAIL PROTECTED]> wrote: > Bernard Lebel wrote on Fri, 8 Apr 2005 15:05:13 -0400: > > > I'm experimenting with basic inheritance concepts, and something that > > I would assume to work returns an error. > > > class A:

RE: [Tutor] Talking to mssql?

2005-04-11 Thread Ryan Davis
I couldn't compile it either, but got it working by copying the MSSQL.py and bin/python2.3/mssqldb.pyd from the archive to my site-packages directory. He scarcely mentions that option at the bottom of the install page: http://www.object-craft.com.au/projects/mssql/install.html. Not sure if the b

Re: [Tutor] Flatten

2005-04-11 Thread C Smith
Sorry for the delay in answering. Bill Mill wrote: [cut] 1) you should special-case dictionaries: > >> x = [1, 2, [3, 4, 5, [[6, 7], 8]], 'abc', 9, [10, 11], {'test': 12}] > >> flatten(x) > >> x [1, 2, 3, 4, 5, 6, 7, 8, 'abc', 9, 10, 11, 'test'] OK, now it only handles lists and tuples 2) What's