Skip to main content
Stack Overflow
  1. About
  2. For Teams

Return to Revisions

1 of 2
cforbish
  • 8.9k
  • 3
  • 32
  • 32
  1. Does not have to, but if the class is used by several other files/classes it should.
  2. It is a good practice see What does <if __name__=="__main__":> do?
  3. Python looks at $PYTHONPATH which is a list of directories to find modules in. You can put modules in subdirectories of one of these directories and import them with import directoryname.module.. You can import a class by from directoryname.module import ClassName.
cforbish
  • 8.9k
  • 3
  • 32
  • 32

AltStyle によって変換されたページ (->オリジナル) /