How to import another python script using _init_.py?

  1. If I wan’t to Import another python script and also run that script using layout panel, How to do that ?
  2. can a layout panel be made in init.py file.
    Please Help me.

Something for your bookmarks: https://docs.python.org/3.7/ :wink:

  1. Imports work like this: from .foo import Foo
    see here:
    https://docs.python.org/3/reference/import.html#submodules
    https://docs.python.org/3/reference/import.html#package-relative-imports

  2. Yes, you can write a Panel class within the __init__.py file.

1 Like