Skip to content

How to package your code to share with others #182

Answered by craigbarratt
gavlig asked this question in Q&A
Discussion options

You must be logged in to vote

You should turn your module into a package by putting it in a subdirectory:

pyscript/
    bedroom.py
    living_room.py
    modules/
        area_controller/
            __init__.py

The key thing is that in a package, the main file is always called __init__.py. Then if you want to share your area_controller package you would share the directory pyscript/modules/area_controller.

Replies: 1 comment 1 reply

Comment options

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

Answer selected by gavlig
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants