Skip to content

[Question] Is there a way to be able to import non standard libraries? #264

Answered by dlech
nmacafee asked this question in Q&A
Discussion options

You must be logged in to vote

We have from pybricks.tools import wait instead of the standard time.sleep() function.

In the REPL, you can run help('modules') to see what modules are available.

Related issues:

In general though, since we are using MicroPython instead of regular Python, using regular Python code is not really possible without significant modifications.

Although you could make some glue code like:

def sleep(time):
    wait(time * 1000)

Replies: 2 comments 4 replies

Comment options

You must be logged in to vote
3 replies
@nmacafee
Comment options

@Freezehot
Comment options

@XilefTech
Comment options

Comment options

You must be logged in to vote
1 reply
@nmacafee
Comment options

Answer selected by nmacafee
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
topic: MicroPython Issues related to the MicroPython programming language
4 participants
Converted from issue

This discussion was converted from issue #263 on February 26, 2021 16:20.