Re: [Tutor] Perfect Python web stack?

2007-01-19 Thread OkaMthembo
Thanks folks, Just to add a bit of chaos :-)...i am settled on using Quicksilver: http://www.quicksilver.net I guess with so many frameworks out there, it all boils down to specific implementations and how much rolling their own one can do. I hope to benchmark Quicksilver performance and i'll rep

[Tutor] 'elp!!!!!!!1Totally Clueless Newbie In Distress

2007-01-19 Thread Karl Wittgenstein
Dear Smart Caring Dude, I've been dabbling into Python for about 6 weeks now.I'm a Social Sciences student who just got interested in programming and chose Python as first language.I have little time to practice and I am just getting into programming concepts,so please be patient,in case you are s

Re: [Tutor] Perfect Python web stack?

2007-01-19 Thread Kent Johnson
OkaMthembo wrote: > Thanks folks, > Just to add a bit of chaos :-)...i am settled on using Quicksilver: > http://www.quicksilver.net Is that the right URL? It doesn't work for me. Kent ___ Tutor maillist - Tutor@python.org http://mail.python.org/mai

Re: [Tutor] 'elp!!!!!!!1Totally Clueless Newbie In Distress

2007-01-19 Thread Geoframer
Alright this code is actually littered with bugs, but don't feel bad, because as you state you are new to the whole programming thing. I'll try to explain the things i see going wrong (please take into account that i'm also a new pythonist ;-)) *** You get the error 'variable undefined' because y

[Tutor] Getting GID info

2007-01-19 Thread Steve Nelson
Hello all, I want to produce stats on file ownership. I am aware that I can use stat to obtain a file statistics tuple, and with the pwd method I can convert the UID to username. However, is there a similar method that will tell me that GID 1 == "staff"? S. _

Re: [Tutor] Getting GID info

2007-01-19 Thread Steve Nelson
On 1/19/07, Steve Nelson <[EMAIL PROTECTED]> wrote: > Hello all, > > I want to produce stats on file ownership. I am aware that I can use > stat to obtain a file statistics tuple, and with the pwd method I can > convert the UID to username. However, is there a similar method that > will tell me t

Re: [Tutor] Filesystem Usage

2007-01-19 Thread Steve Nelson
On 9/22/06, Steve Nelson <[EMAIL PROTECTED]> wrote: > In the end I just did: > > def fsUsage(dir): > """Returns the % usage of a given filesystem""" > stat = os.statvfs(dir) > from statvfs import F_BLOCKS, F_BFREE > total = stat[F_BLOCKS] > avail = stat[F_BFREE] > used = total-avail >

Re: [Tutor] Filesystem Usage

2007-01-19 Thread Kent Johnson
Steve Nelson wrote: > On 9/22/06, Steve Nelson <[EMAIL PROTECTED]> wrote: > >> In the end I just did: >> >> def fsUsage(dir): >> """Returns the % usage of a given filesystem""" >> stat = os.statvfs(dir) >> from statvfs import F_BLOCKS, F_BFREE >> total = stat[F_BLOCKS] >> avail = stat[F_

Re: [Tutor] Filesystem Usage

2007-01-19 Thread Steve Nelson
On 1/19/07, Kent Johnson <[EMAIL PROTECTED]> wrote: > The attribute access uses . notation and an attribute name. You can do > stat.f_blocks and gstat.gr_gid. Python takes care of looking up the > actual attribute value. Excellent - thank you. > I suggest you use the attribute form for both, it

Re: [Tutor] Perfect Python web stack?

2007-01-19 Thread OkaMthembo
Im thoroughly embarrassed. its http://www.clearsilver.net and not quicksilver as i said earlier. thanks Kent. "Shortash" On 1/19/07, Kent Johnson <[EMAIL PROTECTED]> wrote: OkaMthembo wrote: > Thanks folks, > Just to add a bit of chaos :-)...i am settled on using Quicksilver: > http://www.qui

Re: [Tutor] 'elp!!!!!!!1Totally Clueless Newbie In Distress

2007-01-19 Thread Geoframer
Accidentally the number of function definitions does not help the clarity of the program, even though it's completely unclear to me what exactly you are trying to do. :-) I rewrote your program a bit combining the definition of the functions, the comparision of the functions and removed the chance

[Tutor] MD5 Digest for files

2007-01-19 Thread Steve Nelson
Hello, I want to create a dictionary of files and md5sums for a given directory. It seems, however, that md5 works with strings or read-only buffers, and can't be passed a file. What I want to do is something like: for f is os.listdir("."): d[f] = someFunctionThatReturnsMD5Sum(f) Has this wh

Re: [Tutor] 'elp!!!!!!!1Totally Clueless Newbie In Distress

2007-01-19 Thread Geoframer
As i stated i'm somewhat new to python myself so i defined the variables in a somewhat old fashion manner. The correct code is below. I also added some comments because i think you defined the wrong variable somewhere also... Because your code led to comprimento being compared to comprimento_aero

Re: [Tutor] MD5 Digest for files

2007-01-19 Thread Christopher Arndt
Steve Nelson schrieb: > I want to create a dictionary of files and md5sums for a given > directory. It seems, however, that md5 works with strings or > read-only buffers, and can't be passed a file. > > What I want to do is something like: > > for f is os.listdir("."): > d[f] = someFunctionTha

Re: [Tutor] 'elp!!!!!!!1Totally Clueless Newbie In Distress

2007-01-19 Thread Danny Yoo
> I've been dabbling into Python for about 6 weeks now.I'm a Social > Sciences student who just got interested in programming and chose Python > as first language. Out of curiosity, what materials are you using to learn how to program? > Isn't it legal to start a new block of code when start

[Tutor] (no subject)

2007-01-19 Thread Max Jameson
I know this is totally off-the-wall, but what am I doing wrong here? I am using Python 2.5, and I am just learning...please be kind! >>> aList = [2,3] >>> bList = [5,7,9] >>> aList.append(bList) >>> print aList [2, 3, [5, 7, 9]] >>> print aList [1] [2] Traceback (most recent call last): File

Re: [Tutor] (no subject)

2007-01-19 Thread Danny Yoo
On Fri, 19 Jan 2007, Max Jameson wrote: > I know this is totally off-the-wall, but what am I doing wrong here? I > am using Python 2.5, and I am just learning...please be kind! Hi Max, Let's take a look. ### >>> aList = [2,3] >>> bList = [5,7,9] >>>

Re: [Tutor] (no subject) (fwd)

2007-01-19 Thread Danny Yoo
[Forwarding to tutor. Can someone answer Max? Slightly busy at the moment. Quick note: get him to realize that the list he was playing with originally had three elements. The example in his book has two elements. Something has to change. *grin*] -- Forwarded message -- Da

Re: [Tutor] What is a mixin class?

2007-01-19 Thread Danny Yoo
> Wow, Danny. I am impressed. I am not sure that this should not be > called a 'mash-up' rather than a 'mix-in' but it has really been food > for thought. Thank you, but this isn't an original contribution. I mostly adapted the stuff in papers like: http://www.cs.utah.edu/plt/publicati

Re: [Tutor] (no subject) (fwd)

2007-01-19 Thread Eric Walstad
Hey Max, Danny Yoo wrote: > [Forwarding to tutor. Can someone answer Max? Slightly busy at the > moment. Quick note: get him to realize that the list he was playing > with originally had three elements. The example in his book has two > elements. Something has to change. *grin*] > > > --

Re: [Tutor] (no subject)

2007-01-19 Thread Kent Johnson
Max Jameson wrote: > I know this is totally off-the-wall, but what am I doing wrong here? I > am using Python 2.5, and I am just learning...please be kind! > > > > > >>> aList = [2,3] > >>> bList = [5,7,9] > >>> aList.append(bList) > >>> print aList > [2, 3, [5, 7, 9]] > >>> print aList

Re: [Tutor] Correct Way to Start a Python Program Under Linux

2007-01-19 Thread pytutor . 20 . 247ob
> wrote > > I'm not sure what you mean by a filelauncher. > In my window manager I just add the file path to my menu > by editing a dialog box or config file. which environment are you > using? Im using gnome and creating a 'custom application launcher' by rt click a panel and choosing 'add to

[Tutor] Set changing order of items?

2007-01-19 Thread Adam Cripps
I'm adding strings to a Set to prevent duplicates. However, the strings are meant to be in the correct order. When I add the string to the Set, the order seems to change (and I don't seem to be able to predict what order they are in). The string is a simple addition question which should look like

Re: [Tutor] Set changing order of items?

2007-01-19 Thread Simon Brunning
On 1/19/07, Adam Cripps <[EMAIL PROTECTED]> wrote: > I'm adding strings to a Set to prevent duplicates. However, the > strings are meant to be in the correct order. When I add the string to > the Set, the order seems to change (and I don't seem to be able to > predict what order they are in). Sets

Re: [Tutor] Set changing order of items?

2007-01-19 Thread Adam Cripps
On 1/19/07, Simon Brunning <[EMAIL PROTECTED]> wrote: > On 1/19/07, Adam Cripps <[EMAIL PROTECTED]> wrote: > > I'm adding strings to a Set to prevent duplicates. However, the > > strings are meant to be in the correct order. When I add the string to > > the Set, the order seems to change (and I don

[Tutor] messagebox positioning

2007-01-19 Thread Ketan Maheshwari
Hi! All: tkMessageBox.showinfo("done", "You are done!!!") I need to show a message similar to this when some activity is done. However, I want to position this message box in a different part of the screen so that it does not occlude the background. How could I do it? Cheers ketan

Re: [Tutor] Set changing order of items?

2007-01-19 Thread Danny Yoo
On Fri, 19 Jan 2007, Adam Cripps wrote: > I'm adding strings to a Set to prevent duplicates. However, the strings > are meant to be in the correct order. When I add the string to the Set, > the order seems to change (and I don't seem to be able to predict what > order they are in). Hi Adam,

Re: [Tutor] Set changing order of items?

2007-01-19 Thread Python
On Fri, 2007-01-19 at 20:05 +, Adam Cripps wrote: > On 1/19/07, Simon Brunning <[EMAIL PROTECTED]> wrote: > > On 1/19/07, Adam Cripps <[EMAIL PROTECTED]> wrote: > > > I'm adding strings to a Set to prevent duplicates. However, the > > > strings are meant to be in the correct order. When I add t

Re: [Tutor] Set changing order of items?

2007-01-19 Thread Kent Johnson
Adam Cripps wrote: > On 1/19/07, Simon Brunning <[EMAIL PROTECTED]> wrote: >> On 1/19/07, Adam Cripps <[EMAIL PROTECTED]> wrote: >>> I'm adding strings to a Set to prevent duplicates. However, the >>> strings are meant to be in the correct order. When I add the string to >>> the Set, the order seem

[Tutor] wixi.cc to teach python?

2007-01-19 Thread duke
hi.. http://wixi.cc is an idea to teach python using a real-world example of a real-world software for the OLPC: http://wiki.laptop.org/go/wixi also: for dutch developers there's a €30K opportunity http://wixi.cc/index.php?title=digital_pioneers but deadline is soon (5 FEB) feedback welcome.. tha

Re: [Tutor] Redirect from a CGI script

2007-01-19 Thread Paulino
Thank you Andre, well it doesn't work either! Paulino Andre Engels escreveu: 2007/1/18, Paulino <[EMAIL PROTECTED]>: How can i redirect to another URL from a python CGI script. Is's suposed to be as simply as: print "Location : http://newurl " It's not working. this simp

Re: [Tutor] Redirect from a CGI script

2007-01-19 Thread Python
On Sat, 2007-01-20 at 02:10 +, Paulino wrote: > Thank you Andre, > > well it doesn't work either! This works, #!/usr/bin/python print "Location:http://python.org/\r\n\r"; as does this #!/usr/bin/python print "Content-type:text/html\r" print "Location:http://python.org/

Re: [Tutor] Redirect from a CGI script

2007-01-19 Thread Danny Yoo
On Sat, 20 Jan 2007, Paulino wrote: > well it doesn't work either! Hi Paulino, Try being more descriptive: what does your program look like now? It sounds like you've made a few changes. If you can show us the program, we'll do what we can to pinpoint the problems.