Re: looking for way to include many times some .py code from another python code

2005-03-08 Thread Brano Zarnovican
On Tuesday 08 March 2005 12:41, Martin MOKREJŠ wrote: > cat somefile.py > a = 222 > b = 111 > c = 9 > > cat anotherfile.py > > def a(): > include somefile > postprocess(a) What about : def a(): exec open('somefile.py') postprocess(a) You can even use the optional dictionary parameter:

looking for way to include many times some .py code from another python code

2005-03-08 Thread Martin MOKREJŠ
Hi, I'm looking for some easy way to do something like include in c or PHP. Imagine I would like to have: cat somefile.py a = 222 b = 111 c = 9 cat somefile2.py self.xxx = a self.zzz = b self.c = c self.d = d cat anotherfile.py def a(): include somefile postprocess(a) def b(): include som