我在Anaconda工作时遇到代理问题.
当我有以下环境变量时:
http_proxy: http://domain\username:password@corp.com:8080
https_proxy: https://domain\username:password@corp.com:8080
Run Code Online (Sandbox Code Playgroud)
要不就
http_proxy: http://server\username:password@corp.com:8080
Run Code Online (Sandbox Code Playgroud)
然后设置git工作.但是Anaconda没有用.我想跑
conda update conda
Run Code Online (Sandbox Code Playgroud)
我得到:
Could not connect to https://repo.continuum.io/pkgs....
Could not connect to https://repo.continuum.io/pkgs....
Run Code Online (Sandbox Code Playgroud)
Anaconda不能使用http吗?并需要一个https代理?因为我认为我的公司可能没有设置https代理服务器(我只看到他们使用http).或者有时我得到错误:
File "c\Anaconda2\", line 340, in wait
waiter.acquire()
KeyboardInterrupt
Could not connect to https://repo.continuum.io/pkgs....
Could not connect to https://repo.continuum.io/pkgs....
Run Code Online (Sandbox Code Playgroud)
我正在使用Windows 7.
我需要帮助替换word文档中的字符串,同时保持整个文档的格式.
我正在使用python-docx,在阅读文档之后,它适用于整个段落,所以我放松了格式,如粗体或斜体字.包括要替换的文本是粗体,我想保持这种方式.我正在使用此代码:
from docx import Document
def replace_string2(filename):
doc = Document(filename)
for p in doc.paragraphs:
if 'Text to find and replace' in p.text:
print 'SEARCH FOUND!!'
text = p.text.replace('Text to find and replace', 'new text')
style = p.style
p.text = text
p.style = style
# doc.save(filename)
doc.save('test.docx')
return 1
Run Code Online (Sandbox Code Playgroud)
因此,如果我实现它并想要类似的东西(包含要替换的字符串的段落丢失其格式):
这是第1段,这是一个粗体文本.
这是第2段,我将替换旧文本
目前的结果是:
这是第1段,这是一个粗体文本.
这是第2段,我将替换新的文本
我有几个文件夹,每个文件夹包含1000多个子文件夹.我必须将其中一些(大约一半)移动到其他位置,具体取决于每个子文件夹中的进度.电子表格中记录了进度,电子表格也提供了其路径.我有以下代码:
Sub open_explorer()
Shell "C:\Windows\explorer.exe /select, K:\user\folder\A\" & ActiveCell.Value, vbMaximizedFocus
End Sub
Run Code Online (Sandbox Code Playgroud)
因此,此代码将打开一个窗口浏览器,其中选择了一个文件(这样的文件是跟随路径+ ActiveCell值的文件.有没有办法一次选择多个文件?让我说我想选择200个单元格,所以Window Explorer将打开所选的200个文件?
感谢您的帮助!
python ×2
anaconda ×1
conda ×1
excel ×1
excel-vba ×1
git ×1
proxy ×1
python-2.7 ×1
python-docx ×1
vba ×1