-3
from module_1 import *

from module_2 import *

Is there a way that I can group the two statements above in one line?

ruohola
  • 21,987
  • 6
  • 62
  • 97

2 Answers2

3

I'm not sure why you would want to do this, however you can do:

import module_1, module_2

Which will import both module_1 and module_2.

This will make the code more self-documented as well, as in, for example you'll have to use module_1.method(), but it's up to you.

You may also want to read this post for more information.

banf
  • 39
  • 5
2

No other way than using a semicolon:

from module_1 import *; from module_2 import *

But this is a very pointless thing and you should never do this.

ruohola
  • 21,987
  • 6
  • 62
  • 97