I have a noob question.
I got a python script path1/path2/file.py
The script has a function:
def run (datetime = None):
In the shell I call
import path1.path2.file
import datetime
path1.path2.file.run(datetime = datetime(2011,12,1))
but I am getting
TypeError: ‘module’ object is not callable
whats the correct way to call the method in the shell?
The problem is actually in the datetime module.
You are trying to call the module itself.
The function you want to call is itself called datetime.
so what you want to call is:
OR you can import the function with:
and then call it with: