Re: How to pass a global variable to a module?

2009-09-30 Thread Hendrik van Rooyen
On Tuesday, 29 September 2009 20:24:53 Mars creature wrote: From the link Gregor posted, it seems no way to share variable between modules. I can understand the point that global variables tends to mess up programs. Assume that I have 10 parameters need to pass to the function. If these

Re: How to pass a global variable to a module?

2009-09-30 Thread Jean-Michel Pichavant
Mars creature wrote: On Sep 29, 12:49 pm, Rami Chowdhury rami.chowdh...@gmail.com wrote: On Tue, 29 Sep 2009 09:40:29 -0700, Mars creature jin...@gmail.com wrote: Dear Python users, I just start to use python and love this language. I met this problem when I try to save my functions

Re: How to pass a global variable to a module?

2009-09-30 Thread Mars creature
On Sep 30, 5:31 am, Jean-Michel Pichavant jeanmic...@sequans.com wrote: Mars creature wrote: On Sep 29, 12:49 pm, Rami Chowdhury rami.chowdh...@gmail.com wrote: On Tue, 29 Sep 2009 09:40:29 -0700, Mars creature jin...@gmail.com wrote: Dear Python users,   I just start to use python

Re: How to pass a global variable to a module?

2009-09-30 Thread Mel
Mars creature wrote: On Sep 30, 5:31 am, Jean-Michel Pichavant jeanmic...@sequans.com wrote: Mars creature wrote: On Sep 29, 12:49 pm, Rami Chowdhury rami.chowdh...@gmail.com wrote: On Tue, 29 Sep 2009 09:40:29 -0700, Mars creature jin...@gmail.com wrote: Dear Python users, I

How to pass a global variable to a module?

2009-09-29 Thread Mars creature
Dear Python users, I just start to use python and love this language. I met this problem when I try to save my functions in a separate file. The question is how I can pass a global variable to a function which is saved in another file. If I save the function I defined in the same file with the

Re: How to pass a global variable to a module?

2009-09-29 Thread Gregor Horvath
Hi, Am Tue, 29 Sep 2009 09:40:29 -0700 (PDT) schrieb Mars creature jin...@gmail.com: I just start to use python and love this language. I met this problem when I try to save my functions in a separate file. The question is how I can pass a global variable to a function which is saved in

Re: How to pass a global variable to a module?

2009-09-29 Thread Jean-Michel Pichavant
Mars creature wrote: Dear Python users, I just start to use python and love this language. I met this problem when I try to save my functions in a separate file. The question is how I can pass a global variable to a function which is saved in another file. If I save the function I defined in

Re: How to pass a global variable to a module?

2009-09-29 Thread Rami Chowdhury
On Tue, 29 Sep 2009 09:40:29 -0700, Mars creature jin...@gmail.com wrote: Dear Python users, I just start to use python and love this language. I met this problem when I try to save my functions in a separate file. The question is how I can pass a global variable to a function which is saved

Re: How to pass a global variable to a module?

2009-09-29 Thread Mars creature
On Sep 29, 12:49 pm, Rami Chowdhury rami.chowdh...@gmail.com wrote: On Tue, 29 Sep 2009 09:40:29 -0700, Mars creature jin...@gmail.com wrote: Dear Python users,   I just start to use python and love this language. I met this problem when I try to save my functions in a separate file. The

Re: How to pass a global variable to a module?

2009-09-29 Thread MRAB
Mars creature wrote: On Sep 29, 12:49 pm, Rami Chowdhury rami.chowdh...@gmail.com wrote: On Tue, 29 Sep 2009 09:40:29 -0700, Mars creature jin...@gmail.com wrote: Dear Python users, I just start to use python and love this language. I met this problem when I try to save my functions in a

Re: How to pass a global variable to a module?

2009-09-29 Thread Terry Reedy
Mars creature wrote: I just start to use python and love this language. I met this problem when I try to save my functions in a separate file. The question is how I can pass a global variable to a function which is saved in another file. This question is somewhat mis-phrased. In Python, one

Re: How to pass a global variable to a module?

2009-09-29 Thread Dave Angel
Mars creature wrote: snip I can understand the point that global variables tends to mess up programs. Assume that I have 10 parameters need to pass to the function. If these parameters are fixed, I can use another module to store these 10 parameters, and import to the module, as suggested by

Re: How to pass a global variable to a module?

2009-09-29 Thread alex23
Mars creature jin...@gmail.com wrote: Assume that I have 10 parameters need to pass to the function. If these parameters are fixed, I can use another module to store these 10 parameters, and import to the module, as suggested by jean-michel. But what if these 10 parameters will be changed in