Advised way of importing libraries
See original GitHub issueI was wondering how you can import libraries other than the ones imported by default by Belay. I’ve made a @device.task def setup():
function which works well, but is that the intended way? As a side note I’m awaiting Micropython v1.20 which includes mip
(so you should be able to install using mip install <package>
if I’ve understood correctly). Maybe it would be a nice addition to have a “installing and importing libraries” section in the documentation?
Issue Analytics
- State:
- Created 10 months ago
- Comments:9 (9 by maintainers)
Top Results From Across the Web
Python import: Advanced Techniques and Tips
While it's a good idea to separate scripts and libraries, all Python files can be both executed and imported.
Read more >How to import a library in Python – with example - CodeBerry
In this article, you'll learn how to import a library in Python. ... There are a number of ways we can install various...
Read more >Importing modules in Python - best practice - Stack Overflow
Imports should usually be on separate lines, e.g.: · Imports are always put at the top of the file, just after any module...
Read more >How to Import All Python Libraries With One Line of Code
You import libraries, use some of them, and start working. ... These options should work the same way, but you know, Python can...
Read more >How to import modules, packages, functions, etc. in Python
In Python, you can import the standard library, packages installed with pip, your own packages, and so on, with the import statement.5.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
The package manager is already dawning on me. I really really like it! However, I’m a bit confused by:
Does that mean you cannot have just a
pyproject.toml
file, the python script and nothing else in a repo? (except for the autogenerated.belay-lib
).Edit: I’ll make a separate issue for discussion of the package manager.
@roaldarbol checkout #54 and provide feedback in the PR. I’m going to close this issue for now.