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:
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