天天看点

linux http代理设置

$ export https_proxy=https://用户名:密码@代理地址:代理端口

如果直接输入 BASH 会报错: bash: [email protected]: event not found

解决办法 就是将特殊字符转换成 ASIIC 码形式输入, 以 % + Hex 形式(0x忽略).

参考链接: ASCII Reference

比如常见的会出现在密码中的特殊字符:

~ : 0x7E,         ! : 0x21    

@ : 0x40,         # : 0x23  

$ : 0x24,         % : 0x25  

^ : 0x5E,         & : 0x26  

* : 0x2A,         ? : 0x3F   

poet_name = "hp123!@#"

>>> url_code_name = urllib.quote(poet_name)

>>> print url_code_name

hp123%21%40%23

import urllib

user="李白"

user = urllib.quote(user)

继续阅读