当前位置:首页 - Python

python如何引用不同模块下的相同方法(函数)名

作者:高景洋 日期:2020-02-22 15:45:26 浏览次数:2637

在实际开发过程中,会遇到,引用不同模块下相同文件名的情况,那这种情况如何解决呢?



from apps.collect.download.data_download import main as download_main
from apps.collect.parse.data_analysis import main as analysis_main
from apps.collect.process.data_dataaccess import main as dataaccess_main


通过给引用方法,添加别名的方法来解决

本文永久性链接:
<a href="http://r4.com.cn/art127.aspx">python如何引用不同模块下的相同方法(函数)名</a>
当前header:Host: r4.com.cn X-Host1: r4.com.cn X-Host2: r4.com.cn X-Host3: 127.0.0.1:8080 X-Forwarded-For: 18.97.14.81 X-Real-Ip: 18.97.14.81 X-Domain: r4.com.cn X-Request: GET /art127.aspx HTTP/1.1 X-Request-Uri: /art127.aspx Connection: close User-Agent: CCBot/2.0 (https://commoncrawl.org/faq/) Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8 Accept-Language: en-US,en;q=0.5 Accept-Encoding: br,gzip