Apr-13-2021, 06:39 PM
Hi!
In my 'main.py' I have this:
Do I have to but "class ScalableLabel(Label):" in a third 'common.py' module and import that in both of the others?
In that case I guess I would have to import Label in 'common.py'.
In my 'main.py' I have this:
class ScalableLabel(Label): pass from sharebox_ios_etc import ShareBoxAnd in 'sharebox_ios_etc.py' I have this:
class ShareBox(ScalableLabel):But that line produces this error:
Error: Traceback (most recent call last):
File "/mnt/4AF15A0435E762B4/mypython/GeoESP/main.py", line 70, in <module>
from sharebox_ios_etc import ShareBox
File "/mnt/4AF15A0435E762B4/mypython/GeoESP/sharebox_ios_etc.py", line 15, in <module>
class ShareBox(ScalableLabel):
NameError: name 'ScalableLabel' is not defined
So how can I refer to a class defined in the main module in an imported module?Do I have to but "class ScalableLabel(Label):" in a third 'common.py' module and import that in both of the others?
In that case I guess I would have to import Label in 'common.py'.