C:\Users\Xpeng>python3 D:\record\cantools.py
module 'cantools' has no attribute 'database'*
下面这样就没问题:
太费解了
C:\Users\Xpeng>python3
Python 3.7.8 (tags/v3.7.8:4b47a5b6ba, Jun 28 2020, 08:53:46) [MSC v.1916 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import cantools
>>> import os
>>> dbc_file_path=r'D:\record\test.dbc'
>>> dbc_db = cantools.database.load_file(dbc_file_path,encoding='gbk')
>>> msg_id_list = []
>>> dbc_db_dict = {}
>>>