Skip to content
Advertisement

Tag: python-2.6

How to get the current running module path/name

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. I would like to obtain the value a.b.c in the module level. So when I receive the -h option, I display the USAGE without the need to actually write down the actual value

Advertisement