How can I import python module properly instead of namespace package

I'm trying to import python module asammdf with:
py.importlib.import_module('asammdf');
it gives me the following:
'<module 'asammdf' (namespace)>'
but the:
'<module 'asammdf' from 'C:\\Program Files\\Python38\\lib\\site-packages\\asammdf\\__init__.py'>'
was expected.
Once I try using the library with:
MDF = py.asammdf.MDF();
I will recieve:
Unable to resolve the name py.asammdf.MDF
Any thouights how can i solve it?
* I already reinstalled python and checked the same lib on python cosole - it works there.

답변 (1개)

Try assigning the import to a variable:
asammdf = py.importlib.import_module('asammdf');
then
MDF = asammdf.MDF();

댓글 수: 4

What should I give to the command "MDF = asammdf.MDF();"?
The path with the measures and DBC? Could you give me an example please?
Thanks
x = asmmdf.MDF('c:/path/to/my/data/sample.mdf')
Hello @Al Danial,
with this command the output is only MFD.start_time, nothing else.
What am I doing wrong?
Also, having chosen the MF4 file, how can I associate the DBC with it?
Thanks
I know almost nothing about asmmdf or its MDF function. Best get that information from the MDF documentation or sources other than this forum.

댓글을 달려면 로그인하십시오.

카테고리

도움말 센터File Exchange에서 Vehicle Dynamics and Scenarios에 대해 자세히 알아보기

제품

릴리스

R2019b

태그

질문:

2022년 9월 12일

댓글:

2024년 9월 4일

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by