我的公司使用某种版本控制档案工具(Microsoft Windows),我想直接从它导入。但我找不到这样做的方法。如何导入可通过url访问的python模块
这里是我的尝试:
>>> import sys
>>> sys.path.append(r"http://some_path_copied_and_pasted/05.Autres%20Outils/Regen_Engine")
>>> sys.path
['C:\\Python26\\Lib\\idlelib', 'C:\\Python26\\python26.zip', 'C:\\Python26\\DLLs', 'C:\\Python26\\lib', 'C:\\Python26\\lib\\plat-win', 'C:\\Python26\\lib\\lib-tk', 'C:\\Python26', 'C:\\Python26\\lib\\site-packages', 'http://some_path_copied_and_pasted/05.Autres%20Outils/Regen_Engine']
>>> import regen_engine as r
Traceback (most recent call last):
File "<pyshell#6>", line 1, in <module>
import regen_engine as r
ImportError: No module named regen_engine
我试图用“”(空格)替换URL中的“%20”,但结果是一样的。我也试过使用imp
模块,但没有更好的。
因此,这里是我的问题:
- 是有可能使从URL导入?
- 如果是的话,我该如何做到这一点?
也许一个解决方案可能是通过Sharepoint的其他一些隐藏路径来访问此文件,因此它的标记将是合适的。
从来没有尝试,但采取对xhtmlhook一看:http://www.boddie.org.uk/python/xhtmlhook/ – mouad 2011-05-30 10:40:42
从我所了解的情况来看,这似乎更多地与xhtml有关的文档目的。我的意思是,Sharepoint作为一个Web门户可见,但我仍然可以通过在具有完整URL的Web浏览器中直接访问我的python脚本。 – 2011-05-30 11:43:40