首先感谢您阅读这个问题
我正在尝试将模块导入新脚本
我正在使用以下命令:
import mosaic.qdfTrajIO as qdf
这将返回以下语法错误:
runfile('C:/Users/reneb/projects/mosaic/mosaic/utilities/mosaicLogging.py',
wdir='C:/Users/reneb/projects/mosaic/mosaic/utilities')
File "C:/Users/reneb/projects/mosaic/mosaic/utilities/mosaicLogging.py", line 50
class mosaicLogging(object, metaclass=metaSingleton):
^
SyntaxError:无效语法
这是第42行到第59行的代码:
class MessageFormatter(logging.Formatter):
def format(self, record):
try:
record.msg = record.msg.strip()
except:
pass
return super(MessageFormatter, self).format(record)
class mosaicLogging(object, metaclass=metaSingleton): #this is where the error takes place
"""A custom logging class that uses the Python logging facility. Logs are automatically saved to a metaMDIO instance,
and to a file log when DeveloperMode is active.
"""
_loggers = {}
log=logging.getLogger()
log.setLevel(logging.DEBUG)
目前没有回答
相关问题 更多 >
编程相关推荐