I\'ve searched and this seems to be a simple question without a simple answer.
I have the file a/b/c.py which would be called with python -m a.b.c
a/b/c.py
python -m a.b.c
When run with -m, sys.path[0] contains the full path to the module. You could use that to build the name.
sys.path[0]
source: http://docs.python.org/using/cmdline.html#command-line
Another option may be the __package__ built in variable which is available within modules.
__package__