[Tutor] Is generator function similar to multi threading?

2007-03-15 Thread ammar azif
Is generator function similar to multi threading? - Don't be flakey. Get Yahoo! Mail for Mobile and always stay connected to friends.___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tuto

Re: [Tutor] windows file permissions

2007-03-15 Thread Kirk Bailey
I answered my own question digging around and testing stuff. Here is my solution for a windows environment: if not os.access(pagename,os.W_OK): print 'Sorry, that file is read only,' print 'Please consult your system administrator' print 'if this file must be modified.'

[Tutor] windows file permissions

2007-03-15 Thread Kirk Bailey
how do I check file permission in windows environments in python? I am modifying an existing editor program in my wiki to refuse to TRY to edit a file if it is set to read only. Until very recently, all my system stuff was in a un*x environment (well, FreeBSD) which is just not the same. -- Sa

Re: [Tutor] trouble with function-- trying to check

2007-03-15 Thread Isaac
I see. Thanks for clarifying that for me. -Isaac On 3/15/07, Kent Johnson <[EMAIL PROTECTED]> wrote: Isaac wrote: > In 5.9 of the Language Reference it says: > > "Comparisons can be chained arbitrarily, e.g., |x < y <= z| is > equivalent to |x < y and y <= z" > > |So this would mean that > > i

Re: [Tutor] skipping ahead within a loop

2007-03-15 Thread Clay Wiedemann
Thanks, this is not too much information at all. I am always happy with depth. -c On 3/15/07, Dave Kuhlman <[EMAIL PROTECTED]> wrote: > On Thu, Mar 15, 2007 at 03:35:27PM +0100, Rikard Bosnjakovic wrote: > > On 3/15/07, Clay Wiedemann <[EMAIL PROTECTED]> wrote: > > > If doing a loop, how can one

Re: [Tutor] skipping ahead within a loop

2007-03-15 Thread Dave Kuhlman
On Thu, Mar 15, 2007 at 03:35:27PM +0100, Rikard Bosnjakovic wrote: > On 3/15/07, Clay Wiedemann <[EMAIL PROTECTED]> wrote: > > If doing a loop, how can one skip forward a specific amount randomly > > determined within the loop? > > y = 0 > while y < HEIGHT: > linewidth = random(3, 9) > # dra

Re: [Tutor] skipping ahead within a loop

2007-03-15 Thread Kent Johnson
Rikard Bosnjakovic wrote: > On 3/15/07, Clay Wiedemann <[EMAIL PROTECTED]> wrote: >> If doing a loop, how can one skip forward a specific amount randomly >> determined within the loop? > > y = 0 > while y < HEIGHT: > linewidth = random(3, 9) > # drawlines etc > y += linewidth > > The reaso

Re: [Tutor] skipping ahead within a loop

2007-03-15 Thread Rikard Bosnjakovic
On 3/15/07, Clay Wiedemann <[EMAIL PROTECTED]> wrote: > If doing a loop, how can one skip forward a specific amount randomly > determined within the loop? y = 0 while y < HEIGHT: linewidth = random(3, 9) # drawlines etc y += linewidth The reason why you cannot alter the for-variable beats

Re: [Tutor] skipping ahead within a loop

2007-03-15 Thread Jorgen Bodde
Maybe use a while loop? y = 0 while y < HEIGHT: linewidth = random(3,9) y += linewidth Regards, - Jorgen On 3/15/07, Clay Wiedemann <[EMAIL PROTECTED]> wrote: > If doing a loop, how can one skip forward a specific amount randomly > determined within the loop? > Below is a boiled down ve

[Tutor] skipping ahead within a loop

2007-03-15 Thread Clay Wiedemann
If doing a loop, how can one skip forward a specific amount randomly determined within the loop? Below is a boiled down version of what I am trying (HEIGHT and random come from NodeBox). I imagine a simple solution is out there, my searches failed me for y in range(HEIGHT): linewidth = r

Re: [Tutor] Working with files with python (gtk)

2007-03-15 Thread Eike Welk
Hello Edward! On Thursday 15 March 2007 03:53, Edward A Robinson wrote: > I guess what Im looking for is a python command that dose what the > file command in the shell would do I don't think there is anything like this in Python's standard library. Probably Gnome has a library for identifying t

Re: [Tutor] trouble with function-- trying to check

2007-03-15 Thread Kent Johnson
Isaac wrote: > In 5.9 of the Language Reference it says: > > "Comparisons can be chained arbitrarily, e.g., |x < y <= z| is > equivalent to |x < y and y <= z" > > |So this would mean that > > item == item in word2 > > means: > > item == item and item in word2 > > not > > (item == item) and

Re: [Tutor] Working with files with python (gtk)

2007-03-15 Thread Tim Golden
Edward A Robinson wrote: > I guess what Im looking for is a python command that dose what the > file command in the shell would do > > On 3/14/07, Edward A Robinson <[EMAIL PROTECTED]> wrote: >> This is my first time posting to the python tutor so be nice, I have >> read the mailing list and cant