Skip to content

[Question] [Control+] Random Number #41

Closed
Closed

Description

@GianCann

The random module it's not present?

import random
...
...
...

Traceback (most recent call last):
  File "main.py", line 5, in <module>
ImportError: can't import name random

Activity

  1. added
    support
    triage
    on Jun 12, 2020
  2. added
    platform: Powered Up
    and removed
    triage
    on Jun 12, 2020
  3. dlech commented on Jun 12, 2020

    @dlech
    Member

    The urandom module is not currently enabled, but that is probably a useful one to enable if we have enough free space. Give this issue a 👍 if you agree.

  4. added and removed
    support
    on Jun 17, 2020
  5. dlech commented on Jun 17, 2020

    @dlech
    Member

    urandom is enabled in pybricks/pybricks-micropython@38b57c7 (all hubs except MoveHub).

    Tip: no need to call seed(), this is done automatically when you import the urandom module.

  6. Patlepirate01 commented on Jun 17, 2020

    @Patlepirate01

    Sorry for my question but the status is not fully clear for me... is it now available or not ? And if yes how to do it ?

  7. dlech commented on Jun 17, 2020

    @dlech
    Member

    We haven't updated the firmware at code.pybricks.com yet, but for those who can't wait, the latest builds are here.

    Click on a build (top is most recent) and then click on artifact to download it. Then open your downloads folder in a file browser. Click and drag the zip file to the firmware download button at code.pybricks.com.

    When we do update the main app, we will announce it in #48.

  8. Patlepirate01 commented on Jun 17, 2020

    @Patlepirate01

    Thanks. I Will try. I would like to update my haunted house with the lights flashing as thunder and store it on the brick. I was already able to upload my own code on the brick...

  9. Patlepirate01 commented on Jun 17, 2020

    @Patlepirate01

    Ok. I was able to upload the last version and i'm now import urandum... Thanks again for your great and fast support. No it's time for the coding ;-)

  10. added theissue type on Aug 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    platform: Powered Up

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions