How to re import module?

General discussions and questions abound development of code with MicroPython that is not hardware specific.
Target audience: MicroPython Users.
Post Reply
kkumar326
Posts: 16
Joined: Wed Nov 15, 2017 5:30 am

How to re import module?

Post by kkumar326 » Wed Nov 15, 2017 5:47 am

I'm running a loop in which I'm importing a custom script schedule.py
I'm updating schedule.py script in the same loop after the import.
How to make fresh import of schedule.py on top of the loop so that I can get the new variable values from it?

User avatar
pythoncoder
Posts: 5956
Joined: Fri Jul 18, 2014 8:01 am
Location: UK
Contact:

Re: How to re import module?

Post by pythoncoder » Wed Nov 15, 2017 8:33 am

Peter Hinch
Index to my micropython libraries.

kkumar326
Posts: 16
Joined: Wed Nov 15, 2017 5:30 am

Re: How to re import module?

Post by kkumar326 » Sat Nov 18, 2017 7:06 am

[quote=pythoncoder post_id=23238 time=1510734823 user_id=265]
Is this any help [url]viewtopic.php?f=2&t=413&p=7609[/url]?
[/quote]

Instead of deleting the module, I'm simply changing variable value in realtime. Since, my purpose is to import few variable values only, this would be a better approach.

Post Reply