Reputation: 1487
For example, something like this:
import module.main
import module2.main
module.main()
module2.main()
Would it be possible to import specific functions from different modules, but be able to differentiate them if they have the same name by a syntax such as the one above?
Upvotes: 1
Views: 527
Reputation: 780871
Use as
to assign a new name:
import module.main as main1
import module2.main as main2
main1() # module.main()
main2() # module2.main()
Upvotes: 3