Python: How to import, from two modules, Classes that have same names?

前端 未结 2 1243
忘掉有多难
忘掉有多难 2021-01-14 22:57

I\'m writing a python programm to do granular syncs between different DB.

I\'m using SQLAlchemy and a module named sqlautocode for DB inspecting and Schema Classes p

2条回答
  •  猫巷女王i
    2021-01-14 23:31

    Just import the modules and don't try to pull the names from them. from X import Y should be used sporadically, anyway.

    import module_a
    import module_b
    
    module_a.x
    module_b.x
    

提交回复
热议问题