import urllib,urlparseurl = urlparse.urlunsplit(("http","lmbtfy.bangbang93.com","/",urllib.quote("百度一下"),""))print (url)