Consider 3 file, a.py, b.py, c.py
a.py file
import time
import selenium
Login()
xyz
b.py file
import time
import selenium
Login()
abc,
c.py file
import time
import selenium
Login()
efg
what is the better way of managing the above file so that it should not repeat import statement and function.
CodePudding user response:
You can do like this:
# a.py
import time
import selenium
# b.py
from a import time, selenium #You can do like this...
# c.py
from b import * #...or like this
Anyway both the way of doing this are not recommended, you should better import al the needed modules at the beginning of your single files.
