0

I organized my helper method into this way:

enter image description here

All the methods are used in the current file, so I need to import them like this:

from helpers.utility_helper import * from helpers.app_helper import * from helpers.gmm_helper import * from helpers.plot_helper import * 

So I can directly use methods in each of the submodule. For example, use my_helper() instead of helpers.utility_helper.my_helper().

But this looks quite verbose, is it possible to combine them into one line? Something may look like

import * from helpers/*

0

1 Answer 1

0

I would advise to use explicit imports instead of importing whole:

from helpers.utility_helper import my_helper, your_helper 

This will help to avoid mistakes.

For short names you can use as:

import helpers.utility_helper as util import helpers.app_helper as app import helpers.gmm_helper as gmm import helpers.plot_helper as plot 

It is quite normal practice.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.