$ 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)