Re: [Tutor] Variables don't change when altered within a loop?

2006-06-30 Thread Alan Gauld
 > Hi, I just started picking up python yesterday, and have already come> across something that has me stumped.  I want some code that does> this:> > a = foo(a)> b = foo(b)> c = foo(c)> > So I try to do this with a for loop, like so:> > for i in [a, b, c]:>   i = foo(i)>   print i # ma

Re: [Tutor] Wiget

2006-06-30 Thread Alan Gauld
> The problem is at the end where i try and get the number of > Tries the user has tried it would just reset everytime the button > in clicked, so my question is how would i go about getting > the number of times the button is clicked and the anwser is wrong. >def number_anwser(self): >

[Tutor] Python urllib (linux)

2006-06-30 Thread Patty
Hi all, I'm doing some failure testing for a python script that uses urllib and urllib2 to open a web page and post data. If the server's apache is down or if I change the ip address the script is trying to contact to be a bogus address, the script handles it prefectly. When I unplug the ethernet

Re: [Tutor] Python urllib (linux)

2006-06-30 Thread Python
On Fri, 2006-06-30 at 13:58 +, Patty wrote: > Hi all, > I'm doing some failure testing for a python script that uses urllib and > urllib2 > to open a web page and post data. If the server's apache is down or if I > change > the ip address the script is trying to contact to be a bogus address

Re: [Tutor] Python urllib (linux)

2006-06-30 Thread Terry Carroll
On Fri, 30 Jun 2006, Patty wrote: > I'm doing some failure testing for a python script that uses urllib and > urllib2 to open a web page and post data Is there a way I can > implement a timeout to handle this problem? I don't have any firsth-hand knowledge on this, but http://www.voidspace.o

Re: [Tutor] Python urllib (linux)

2006-06-30 Thread Patty
Hi again, > > problem? > import socket > if not socket.getdefaulttimeout(): > socket.setdefaulttimeout(25.0) > I'm sorry I forgot to mention that I'm using python 2.2.3, and this version doesn't have those methods. Patty ___ Tutor m

Re: [Tutor] Unit testing

2006-06-30 Thread Christopher Arndt
Terry Carroll schrieb: > You can just use a series of Queues, where each Queue represents the work > being passed from one thread to the other. If you want, you can have a look at my threadpool module, which implements exactly this pattern. It is basically nothing more than an elaborate example o

[Tutor] saving output in a text file

2006-06-30 Thread Hafsa raza
Hi, my name is Hafsa   I am new to programming in Python. Basically i am working with regular _expression_ matching using Python. I have a problem with saving output from the regular _expression_ matches in a text file. Can you guide me how to save the output returned by a regular _expression_ grou

Re: [Tutor] classes and functions

2006-06-30 Thread Mike Hansen
> -Original Message- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] On Behalf Of anil maran > Sent: Thursday, June 29, 2006 12:51 PM > To: Tutor > Subject: [Tutor] classes and functions > > how to use classes and functions in python > thanks What do you need to know? Have you r

Re: [Tutor] saving output in a text file

2006-06-30 Thread Danny Yoo
Hi Hafsa, > Can you guide me how to save the output returned by a regular expression > group, into a text file? for instance for the following regular > expression: [regex cut] > If the above regular expression is searched for in a file, how can i > save the output matches from the group "na

Re: [Tutor] saving output in a text file

2006-06-30 Thread Danny Yoo
>def double(s): >"double: string -> string >doubles up the input string s." >return s + s Gaah. Typos. My apologies. Here's a correction to double() def double(s): """double: string -> string Doubles up the input string s. For example, double("