从网络导入模块 [英] Importing module from network
问题描述
有没有办法让python从网络中读取模块?
Is there a way to get python to read modules from a network?
我们有很多机器,每次更换模块时手动更新每台机器都需要付出太多努力,所以我希望python从一个位置获取模块网络。
We have many machines and it would be a too much effort to update each machine manually each time I change a module so I want python to get the modules from a location on the network.
有任何想法吗?
推荐答案
安装网络位置进入您的文件系统并将该路径添加到您的PYTHONPATH。这样,本地计算机上的Python将能够看到远程位置中存在的模块。
您无法远程直接从模块导入,例如在html中指定js文件。
Mount your network location into your file-system and add that path to your PYTHONPATH. That way, Python on your local machine will be able to see the modules which are present in the remote location. You cannot directly import from modules remotely, like specifying a js file in html.
这篇关于从网络导入模块的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!