Re: [Tutor] about threads

2006-08-15 Thread Luke Paireepinart
[EMAIL PROTECTED] wrote: > Hi all, > Hi! > my question is probably about the threads... I have two IPs > and i want to run web.py server for each IP in the same > time from one script file. I can run them in two command > boxes (and this works) but i want to do this from one ;-) > > if you ru

[Tutor] about threads

2006-08-15 Thread emilia12
Hi all, my question is probably about the threads... I have two IPs and i want to run web.py server for each IP in the same time from one script file. I can run them in two command boxes (and this works) but i want to do this from one ;-) Maybe i can do this with 'threads' but how ? is there some

Re: [Tutor] threading

2006-08-15 Thread Danny Yoo
> It kinda depends what your thread is doing, and what technique you are > using to keep it alive, but one possibility is to do something like: > > class Worker(threading.Thread): >def run(self): >self.running = True >while(self.running): ># do stuff > >def st

Re: [Tutor] threading

2006-08-15 Thread Jeff Peery
h, ok, well that is what I am currently doing but something is causing it to continue... guess I have some digging around to do. thanks for the help!JeffJohn Fouhy <[EMAIL PROTECTED]> wrote: On 16/08/06, Jeff Peery <[EMAIL PROTECTED]> wrote:> hello, how do I stop a thread? do I need to kill it

Re: [Tutor] threading

2006-08-15 Thread John Fouhy
On 16/08/06, Jeff Peery <[EMAIL PROTECTED]> wrote: > hello, how do I stop a thread? do I need to kill it or can I simply call a > stop function... kinda like the start function? I read a bit on google and > it sounded like using a kill isn't recommended for some reason... so how is > this thing sto

[Tutor] threading

2006-08-15 Thread Jeff Peery
hello, how do I stop a thread? do I need to kill it or can I simply call a stop function... kinda like the start function? I read a bit on google and it sounded like using a kill isn't recommended for some reason... so how is this thing stopped? thanks!Jeff Yahoo! Messenger with Voice. Make PC-t

Re: [Tutor] What does import really do?

2006-08-15 Thread Kent Johnson
jim stockford wrote: > many thanks. > wrt import and what's named, in the case of > the PIL library, the import statement can be > import Image # not import PIL > That is because the directory Lib/site-packages/PIL is in sys.path, so any PIL module can be imported directly without the PIL p

[Tutor] getting and storing favicon.ico

2006-08-15 Thread anil maran
/favicon.icoi want to get the favicon.ico from the URL when a blog is added to the aggregatorand then display the image,this is the usage scenarioPlease let me know how to do this in pythoni m willing to use os.spawnv() and call convert if need bethanks a lot Do you Yahoo!? Everyone is raving

Re: [Tutor] Python on network problems

2006-08-15 Thread Diana Hawksworth
Thanks Alan and Barry. Both your ideas seem sensible - and I shall pass them onto the systems administrator. We had thought that the problem could be coming from the "save" and Barry's explanation makes a lot of sense. Shall try today saving to the local machine and see what happens. Diana

Re: [Tutor] more rps

2006-08-15 Thread Bob Gailer
FWIF Here's my "minimalist" version: # rock paper scissors import random media = ('rock', 'paper', 'scissors') outcome = ('tie', 'human', 'computer') winner = ((0,2,1), (1,0,2), (1,2,0)) print 'Human Computer Winner' while 1: h = "rpsvq".find(raw_input('Rock Paper Scissors Verify Quit').lo

Re: [Tutor] Python on network problems

2006-08-15 Thread Alan Gauld
> If possible, I would recommend using a Unix clone as your > server's OS instead of Windows. Even Linux, Speaking personally I can't complain about Windows as a server since windows 2000. NT was horrible but Win2K seems to do a fair job. BUT it does need to be set up correctly and running

Re: [Tutor] more rps

2006-08-15 Thread Luke Paireepinart
[snip] > > class Computer: > >def __init__(self): > > self.points = 0 > > self.choice = " " > > > > def plays(self): > > comp_choice = random.randint(0,2) > > if comp_choice == 0: > >self.choice = 'rock' > > elif comp_choice == 1: > >self.choice = 'paper'

Re: [Tutor] Python on network problems

2006-08-15 Thread Carroll, Barry
Hello, Diana, I have had a little experience with networking problems. Here's my take on your situation. Regards, > Date: Tue, 15 Aug 2006 11:19:35 +1000 > From: Diana Hawksworth <[EMAIL PROTECTED]> > Subject: Re: [Tutor] Python on network problems > To: Alan Gauld <[EMAIL PROTECTED]> > Cc:

Re: [Tutor] The In Operator

2006-08-15 Thread Steve Haley
Hi all,   I didn't forget about this - I got involved with some other things, was away for a little while, etc.  Thanks for the help.  I have tried statements that version 2.1 understands and the "in operator" (so to speak in ver. 21) works fine.  As far as downloading a more recent version, I look

Re: [Tutor] more rps

2006-08-15 Thread Alan Gauld
Let me start by saying that your code is pretty much OK as is. Indeed even using clssses for an RPS game is probably overkill to some extent.   What follows should be seen more as some ideas for experimentation and building towards a more flexible/expandable architecture for future pr

Re: [Tutor] processing multi entry logs

2006-08-15 Thread Alan Gauld
>I have a log file. Essentially the file has 2 important entries for > each process id. One when the process starts with an id and a > another > piece of data. the second is when the process finishes, with the > result also with the process id. > I can't think of an efficient way to store the da

Re: [Tutor] Python on network problems

2006-08-15 Thread Alan Gauld
Thanks Diana, > We are running Windows XP. The students log in to a > network server that allows them access to their user > accounts as well as various group folders. > We have 4 rooms full of computers - but Python is installed > on each workstation in this room only It is not on the netwo

Re: [Tutor] Global variables

2006-08-15 Thread Alan Gauld
> That may be true but you will make your code much less reusable > and much more error propne in the process. There are good reasons > why global variables are considered evil... > > But in fact I use the same variable names in the subroutine > parameter list > as in the calling routine for ever

Re: [Tutor] more rps

2006-08-15 Thread Wolfram Kraus
On 15.08.2006 08:42, Christopher Spears wrote: > Here is the latest version of my Rock, Paper, Scissors > game: > > #!/usr/bin/python > > import random > random.seed() > > class Human: > def __init__(self): > self.points = 0 > self.choice = " " >

Re: [Tutor] How to un-import modules?

2006-08-15 Thread Dick Moores
At 02:19 PM 8/14/2006, you wrote: >Michael P. Reilly wrote: >>On 8/14/06, *Dick Moores* <[EMAIL PROTECTED] > >>wrote: >> >> Actually, my question is, after using IDLE to do some importing of >> modules and initializing of variables, how to return it to it's >>