Getting different result for _import_() and import #12004
Replies: 1 comment
-
Found the answer. changed it to __import__("devlib/motion_1601111") and it worked as expected |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hello Everybody,
I am using micropython on 5100S-EVP-Pico for over a month now. I noticed a curious thing.
My directory structure is like this
When I open a system shell for the 5100S-EVP-Pico, and import devlib.motion_1601111, I get all classes as expected
When I write a py script with same commands in Thonny, and run the script, I get the same result.
BUT
Instead of import, If I use __import__() in the py script, I get very different result


In this case, all internal members of motion_1601111 module are missing. Why is it so? Isn't __import__ exactly same as import?
How to get exactly same result as 'import' using micropython?
Appreciate any help or pointer towards a solution.
Thanks a ton.
--Kish
Beta Was this translation helpful? Give feedback.
All reactions