Re: [Tutor] Watch and control access to an executable

2006-04-08 Thread Bill Burns
[Bill] >> If I'm not mistaken (and I certainly could be) I believe this recipe >> is used to control instances of an already running *script*. While I'm >> trying to control a completely different executable (program) written >> by someone else. [Alan] > Nope, its si8mply creating an arbitrary

Re: [Tutor] Watch and control access to an executable

2006-04-08 Thread Alan Gauld
> If I'm not mistaken (and I certainly could be) I believe this recipe is > used to control instances of an already running *script*. While I'm > trying to control a completely different executable (program) written by > someone else. Nope, its si8mply creating an arbitrary Mutex, which is like

Re: [Tutor] Beginner question (variables, namespaces...) (fwd)

2006-04-08 Thread Danny Yoo
> > ..which is not what I'm aiming for. Maybe I'll have to follow Bob's > > advice and just store all of the variable assignments in a function, > > and then call the function every time I change one of the variables > > (based on user input). I could still leave the higher-order variables > > as f

Re: [Tutor] Beginner question (variables, namespaces...) (fwd)

2006-04-08 Thread Danny Yoo
> I tried redefining the "higher-order" variables as functions, but it > didn't quite work. Here's a simplified example: > > > var1 = 2 > > def timestwo(x): > return x*2 > > var2 = timestwo(var1) > print var1, var2 > var1 = 3 > print var1, var2 Try: ## print 2, timestwo(2) print 3, times

Re: [Tutor] Watch and control access to an executable

2006-04-08 Thread Bill Burns
[Bill] >>>Desktop to the executable). The problem is, only *one* person at a time >>>should run the program. > [Snip some good advise about file problems (that I'll look in to)] [André] > However, there is a Cookbook solution that does, I believe, that what > the original poster asked: > http://

Re: [Tutor] Watch and control access to an executable

2006-04-08 Thread Bill Burns
[Bill] >> Desktop to the executable). The problem is, only *one* person at a time >> should run the program. > [Alan] > The usual way of doing this is simply to create an empty file > when the program starts and delete it when the program closes > In python: > > ## > # File : exRun.p

Re: [Tutor] Watch and control access to an executable

2006-04-08 Thread Alan Gauld
> > The usual way of doing this is simply to create an empty file > > when the program starts and delete it when the program closes > Couldn't this approach cause problems if the Python program crashes, > leaving behind the empty file? Yes, but its very easy for the administrator to delete the ro

Re: [Tutor] Watch and control access to an executable

2006-04-08 Thread Andre Roberge
On 4/8/06, Alan Gauld <[EMAIL PROTECTED]> wrote: > > Desktop to the executable). The problem is, only *one* person at a time > > should run the program. [snip] > > The usual way of doing this is simply to create an empty file > when the program starts and delete it when the program closes > In pyt

Re: [Tutor] Watch and control access to an executable

2006-04-08 Thread Alan Gauld
> Desktop to the executable). The problem is, only *one* person at a time > should run the program. > Now here's my solution: > 1. Create a program let's call it 'myProg' that spawns 'otherProg'. > 2. 'myProg' will utilize a config file. > 3. When 'myProg' is started it looks in the config file t

[Tutor] Bob Gibson is out of the office.

2006-04-08 Thread Bob Gibson
I will be out of the office starting 03/31/2006 and will not return until 04/10/2006. I will respond to your message when I return.___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Beginner question (variables, namespaces...) (fwd)

2006-04-08 Thread Kent Johnson
> From: Jesse <[EMAIL PROTECTED]> > > I tried redefining the "higher-order" variables as functions, but it didn't > quite work. Here's a simplified example: > > > var1 = 2 > > def timestwo(x): > return x*2 > > > var2 = timestwo(var1) > print var1, var2 > var1 = 3 > print var1, var2 > > T

Re: [Tutor] Beginner question (variables, namespaces...)

2006-04-08 Thread Alan Gauld
Others have provided workarounds I'll attempt to answer the rationale part... > Why is it that when one variable is assigned a value in terms of another > variable, assigning a new value to the first doesn't change the value of > the > second? Python variables are just names that refer to a valu