I have written a python package within eclipse and, up until recently, I was running my code exclusively within eclipse. The main for my code was within the file that contains the top level class after the usual
if __name__ == '__main__':
pass
section.
I have now packaged my code up as a whl and, to enable me to call the whl from the command line I have moved the main into an __main__.py and call my package from the command line with the command:
python -m <<my package>> -c config.txt
I'm convinced that the solution is simple, but I can't figure out how to call my package within the pydev debugger. Is it possible?
Yes, that's possible, you just have to turn on the preference on the PyDev preferences to launch with the -m
flag.
i.e.: go to: Preferences > PyDev > Run
and check Launch modules with python -m mod.name
.