Re: Access to variable from external imported module

2006-11-24 Thread jim-on-linux
The TRS-80 I bought came with both Basic and Assembly Language teaching guides, and that was it. To make the machine work one had to program. I didn't mean to imply that Bill Gates developed it. It's well known that MS borrowed stuff when they needed to from where ever the could get it. That's

Re: Access to variable from external imported module

2006-11-24 Thread Steven D'Aprano
On Fri, 24 Nov 2006 16:56:58 -0500, jim-on-linux wrote: > Correct but when writing one must be clear. [jaw drops] Given the number of typos your posts include, the mock accent, the nonsensical sentences, the annoying hard-to-read coding conventions, and the sheer number of grammatical errors in

Re: Access to variable from external imported module

2006-11-24 Thread jim-on-linux
On Friday 24 November 2006 13:41, John Machin wrote: > jim-on-linux wrote: > > On Friday 24 November 2006 03:30, John Machin > > > > wrote: > > > jim-on-linux wrote: > > > > GinTon, > > > > > > > > I think this is what you want. > > > > > > > > > > > > class Kdoi: > > > > > > Is that a typo? > > >

Re: Access to variable from external imported module

2006-11-24 Thread John Machin
jim-on-linux wrote: > On Friday 24 November 2006 03:30, John Machin > wrote: > > jim-on-linux wrote: > > > GinTon, > > > > > > I think this is what you want. > > > > > > > > > class Kdoi: > > > > Is that a typo? >No, it's a style. life seems to be easier > to me if one is consistent, all m

Re: Access to variable from external imported module

2006-11-24 Thread jim-on-linux
On Friday 24 November 2006 13:20, jim-on-linux wrote: > On Friday 24 November 2006 13:01, jim-on-linux > > wrote: > > On Friday 24 November 2006 03:30, John Machin > > > > wrote: > > > jim-on-linux wrote: > > > > GinTon, > > > > > > > > I think this is what you want. > > > > > > > > > > > > class

Re: Access to variable from external imported module

2006-11-24 Thread jim-on-linux
On Friday 24 November 2006 13:01, jim-on-linux wrote: > On Friday 24 November 2006 03:30, John Machin > > wrote: > > jim-on-linux wrote: > > > GinTon, > > > > > > I think this is what you want. > > > > > > > > > class Kdoi: > > > > Is that a typo? > >No, it's a style. life seems to be > ea

Re: Access to variable from external imported module

2006-11-24 Thread jim-on-linux
On Friday 24 November 2006 03:30, John Machin wrote: > jim-on-linux wrote: > > GinTon, > > > > I think this is what you want. > > > > > > class Kdoi: > > Is that a typo? No, it's a style. life seems to be easier to me if one is consistent, all my classes begin with K. > > >def

Re: Access to variable from external imported module

2006-11-24 Thread robert
GinTon wrote: > Thanks Robert, the best solution is get all local variables, else is > impossible access to them. For test purposes/ex post inspection you could also uncomment the line in: def f(a=1): b=2 c=3 #globals().update(locals()) return a+b -- then it is more easy and you

Re: Access to variable from external imported module

2006-11-24 Thread John Machin
jim-on-linux wrote: > GinTon, > > I think this is what you want. > > > class Kdoi: Is that a typo? >def __init__(self) : >self.Fdo() > What is all this K and F stuff? >def Fdo(self): > > searchterm = 'help' > print searchterm #local > > self.searchterm = sear

Re: Access to variable from external imported module

2006-11-23 Thread Fredrik Lundh
GinTon wrote: > Thanks Robert, the best solution is get all local variables, else is > impossible access to them. if you don't want them to be local, why are you using local variables? (have you read the Python tutorial?) -- http://mail.python.org/mailman/listinfo/python-list

Re: Access to variable from external imported module

2006-11-23 Thread GinTon
Thanks Robert, the best solution is get all local variables, else is impossible access to them. robert ha escrito: > GinTon wrote: > > I would to access to values that are created locally in that method > > after the method has executed? usually the return value? > or you want to get all local var

Re: Access to variable from external imported module

2006-11-23 Thread jim-on-linux
GinTon, I think this is what you want. class Kdoi:    def __init__(self) :            self.Fdo()    def Fdo(self): searchterm = 'help' print searchterm #local      self.searchterm = searchterm      print self.searchterm #used inside the class      Kdo.searchterm = searchterm

Re: Access to variable from external imported module

2006-11-23 Thread Bruno Desthuilliers
GinTon a écrit : > Sorry, I mean access to local variable from a method One of the most surprising properties of local variables is that they are, well... local. -- http://mail.python.org/mailman/listinfo/python-list

Re: Access to variable from external imported module

2006-11-23 Thread Bjoern Schliessmann
GinTon wrote: > Sorry, I mean access to local variable from a method > > import module > method(value) That's no access to a local variable of a method. It's a simple function call. > I would to access to values that are created locally in that > method Something with your interface seems hor

Re: Access to variable from external imported module

2006-11-23 Thread robert
GinTon wrote: > Sorry, I mean access to local variable from a method > > import module > method(value) > > I would to access to values that are created locally in that method after the method has executed? usually the return value? or you want to get all local variables, then make a func/method

Re: Access to variable from external imported module

2006-11-23 Thread GinTon
Sorry, I mean access to local variable from a method import module method(value) I would to access to values that are created locally in that method Fredrik Lundh ha escrito: > GinTon wrote: > > > How to access to a variable (that value is not returned) from a module > > imported? > > And the v

Re: Access to variable from external imported module

2006-11-23 Thread Fredrik Lundh
GinTon wrote: > How to access to a variable (that value is not returned) from a module > imported? > And the variable is set at the module-level. import module print module.variable (have you read the Python tutorial?) -- http://mail.python.org/mailman/listinfo/python-list

Access to variable from external imported module

2006-11-23 Thread GinTon
How to access to a variable (that value is not returned) from a module imported? And the variable is set at the module-level. That module is external to my program, it's from another project so I wann't modifying it. -- http://mail.python.org/mailman/listinfo/python-list