Skip to content

Module instead of package #399

Answered by FlorianWilhelm
ghuname asked this question in Q&A
Discussion options

You must be logged in to vote

@ghuname to avoid imports like import scaffmodule.scaffmodule you really have only two options as far as I know:

  1. Put your code into scaffmodule.__init__.py.
  2. Keep your code in scaffmodule.scaffmodule and have in scaffmodule.__init__.py:
    from .scaffmodule import *  # or better explicitly define what you want to import. 
    

Replies: 9 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by abravalheri
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
4 participants
Converted from issue

This discussion was converted from issue #397 on February 05, 2021 09:52.