部分初始化的模块(很可能是由于循环导入)
我读过很多很多关于这个主题的帖子,但每个人都说“重命名文件”。 遗憾的是,我已经完成了多次+重命名类+重命名实例,但没有运气。
当我从文件“measureSys.py”中取出“import start”时,程序会运行直到它必须使用measureSys.py(缺少Main,因为当然我的主类丢失了)
Top Section (measureSys.py)
import start
from modules import loggingSys
from modules import alarmSys
# Creation of instance(object) of class LoggingSystem to log measurement activity
logging = loggingSys.LoggingSystem()
# Creating instance(object) of class AlarmSystem to be able to send alarms to user/email
alarm = alarmSys.AlarmSystem()
starting = start.Main()
class MeasureSystem:
并且该类“start.py”被命名为“Main”
Top Section (start.py)
from modules import measureSys
measureSystem = measureSys.MeasureSystem()
如果我监督某些事情,请联系我:(!
I have read many many many posts about this topic but everyone says "rename file".
Ive done it multiple times now + renaming classes + renaming instances with no luck, sadly.
When I take out "import start" from file "measureSys.py" the program runs until it has to use measureSys.py (missing Main because of course my main class is missing)
Top Section (measureSys.py)
import start
from modules import loggingSys
from modules import alarmSys
# Creation of instance(object) of class LoggingSystem to log measurement activity
logging = loggingSys.LoggingSystem()
# Creating instance(object) of class AlarmSystem to be able to send alarms to user/email
alarm = alarmSys.AlarmSystem()
starting = start.Main()
class MeasureSystem:
And the class in "start.py" is named "Main"
Top Section (start.py)
from modules import measureSys
measureSystem = measureSys.MeasureSystem()
If I oversee something, please hit me up :( !
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论