Calling function within other files and order of loading..
-
I have created different py files for different functions eg bluetooth.py wifi.py etc
When boot.py and main.py load...do the other files get loaded if not when do they get loaded? From boot.py i'm trying to load a function within bluetooth.py but i get error NameError: name '_bluetooth_scan' is not defined
-
@misterlisty Modules are loaded with the "import name_of_module" statement. After that, functions and classes arfe added to the namespace and can be used. You can issue the import statement at the REPL prompt interactively, of in your main script and use it then.
This is the typical Python behaviour. I recommend getting lessons or reading a suitable book on Python. -
thanks, i'm reading the python resource online
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login