On Tue, 6 Feb 2007, Daniel Yoo wrote:
>> this is the callee which is saved in tester.py >> ############################## >> import sys >> >> def main(arg): >> if arg != []: >> print"\nArgument is %s" % arg >> >> if __name__ == "__main__"": >> main(sys.argv) >> ############################## > > This is not safe. I would strongly recommend not to do this. There is a > much simpler way for the caller to be written: > > ############################ > import tester > tester.main([], "argument") > ############################ > > Done. No tricks, no eval() or exec() necessary. ... and also not right. *sigh* Sorry, I meant to write: ######################### import tester tester.main(["argument"]) ######################### My apologies! _______________________________________________ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor