Wensheng wrote:
I just realized I can pass the object itself:
like
p=__import__("printit")
p.pr(self)
Leaving no reason not do do *this* part as
import printit
printit.pr(self)
rather than using the internal hook function to do exactly the
standard thing.
in printit.py
-
def p
I just realized I can pass the object itself:
like
p=__import__("printit")
p.pr(self)
in printit.py
-
def pr(self):
print self.var
---
--
http://mail.python.org/mailman/listinfo/python-list
I have a py program below:
class someclass:
def __init__(self):
self.var = "hell, world"
def printitout(self):
execfile("printit.py")
#__import__("printit") #doesn't work
if __name__=="__main__":