from module_1 import *
from module_2 import *
Is there a way that I can group the two statements above in one line?
from module_1 import *
from module_2 import *
Is there a way that I can group the two statements above in one line?
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.
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.