I am writing a python program where in I have included another python file.
The python file included has a method which I want to invoke from the calling script.
Like:
#!/usr/bin/python
include script1
method = sys.argv[1] # values may be - create or destroy
if method == "create":
script1.create()
elif method == "destroy":
script1.destroy()
Now, what I want is,
#!/usr/bin/python
include script1
method = sys.argv[1] # values may be - create or destroy
script1.method()
and, it should use the value inside the variable method instead of trying to call the module called method
.