开发者社区 问答 正文

python函数使用使用as指定模块的别名的语法形式是怎样的?

python函数使用使用as指定模块的别名的语法形式是怎样的?

展开
收起
游客fbdr25iajcjto 2021-11-04 22:23:24 587 分享 版权
1 条回答
写回答
取消 提交回答
  • from test1 import Cat

    如果重名的话,则第二个导入的覆盖同名的第一个

    from test1 import demo1 as test_demo1 from test2 import demo1

    cat = Cat() print cat test_demo1() demo1()

    2021-11-04 22:24:20
    赞同 展开评论