1
SlickEdit® / A small but nonetheless annoying problem when debugging python scripts
« Last post by ebbe on Today at 03:49:04 PM »I have a python module that contains a set of scripts that I use in my daily work. They have a common version which they get from
the __about__.py file. All these python files are located in the same directory. They are built into an installable module using the hatch build tool.
In order for the scripts to work when they are built and installed, __about__.py needs to be imported like this:
For a bunch of python specific reasons the debugger does not like this:
It works if I change the import to look like this:
But if I build this and try to run it, I get this result:
Is there a way to make SE automatically run a command (in this case a search/replace) before it starts the debugger? And likewise run another command (another search/replace) after the debugger is exits?
the __about__.py file. All these python files are located in the same directory. They are built into an installable module using the hatch build tool.
In order for the scripts to work when they are built and installed, __about__.py needs to be imported like this:
Code: [Select]
from . import __about__.py as verFor a bunch of python specific reasons the debugger does not like this:
Code: [Select]
from . import __about__ as ver
ImportError: attempted relative import with no known parent packageIt works if I change the import to look like this:
Code: [Select]
import __about__.py as verBut if I build this and try to run it, I get this result:
Code: [Select]
import __about__ as ver
ModuleNotFoundError: No module named '__about__'
Is there a way to make SE automatically run a command (in this case a search/replace) before it starts the debugger? And likewise run another command (another search/replace) after the debugger is exits?
Recent Posts