unicode是字符集,Utf-8是編碼方式,你解釋的unicode實(shí)際應(yīng)該是utf-16,這種方式是通用兩個(gè)字節(jié),所以浪費(fèi)空間,utf-8可以節(jié)約空間,但是浪費(fèi)時(shí)間,你這個(gè)解釋似乎不是很準(zhǔn)確。。
2016-08-30
你講錯(cuò)了吧,decode("UTF-8")是把你獲取到的網(wǎng)頁代碼轉(zhuǎn)成UNICODE編碼,beautifulsoup內(nèi)部有自動(dòng)轉(zhuǎn)換功能,這一步也不是必須的,但是最好明確的轉(zhuǎn)換
2016-08-30
安裝報(bào)錯(cuò): 'pymysql' is not a package 請(qǐng)指點(diǎn),一下午都沒過去這個(gè)坎...
File "F:/AG-Data/Space-Python/Code/imooc/wikitomysql.py", line 7, in <module>
import pymysql.cursors
ImportError: No module named 'pymysql.cursors'; 'pymysql' is not a package
Process finished with exit code 1
File "F:/AG-Data/Space-Python/Code/imooc/wikitomysql.py", line 7, in <module>
import pymysql.cursors
ImportError: No module named 'pymysql.cursors'; 'pymysql' is not a package
Process finished with exit code 1
2016-08-29
conn=pymysql.connect('127.0.0.1','root','root','test')
2016-08-28