實作異常的順力^^
1 2 3 4 5 6 7 import base64 fp = open("a.jpg","rb") img = fp.read() fp.close() print(base64.b64encode(img)) 在接下來使用requests來實作
1 2 imgdata = requests.get(imgurl).content imgb64 = base64.b64encode(imgdata) 完成:D
由於用網頁爬蟲抓取的資料存入json
文件都會顯示"{artist": "\u3058\u3093"}
但程式抓取都不會有亂碼的問題
但今天我Google大神一個整天
終於找到方法
1
|
str.encode().decode('unicode_escape')
|
上次參加COSCUP 2014時候,電腦不只會幫你選土豆,還會幫你選新聞
最近無聊做個小實驗
使用requests、BeautifulSoup實作抓資料存成json
結果發現不會太難
最近使用html2canvas圖片都無法順利呈現…
最終在https://github.com/niklasvh/html2canvas/issues/288找到解決問題。
https://github.com/niklasvh/html2canvas/commit/e9afe0396019abc39bdb949d78819ae971bf5f2c
不過使用background-size: xxpx;數值仍然在Firefox上還是有問題
但是background-size:cover和background-size:contain可以順力產生圖片
看到還在用Google翻譯?6個超強網站讓你查到最道地的英文介紹覺得還不錯,記錄一下
Google Netspeak Just the word TANGO Verb Noun Collocation (部分中、英對照) VoiceTube The Corpus of Contemporary American English (COCA) 14個APP好像也不錯低頭族必備!英文想變好,快裝這14個實用英文學習App
之前Ezgo11安裝vagrant都用的還滿順的
突然換到XP來用…,就發現麻煩的不少
沒法只能用XP來用
這次發現CHEFsupermarket改版了
連找cookbooks下載地方都找不太到
最後發現在右下角 = =|||
Cookbooks網址:https://supermarket.getchef.com/
vagrant box add base http://files.vagrantup.com/lucid32.box
This is an indication that the the base virtual image is not configured, usually from forgetting to finish the installation. This image is copied, and modified to produce the desired virtualized environment. It’s easy to fix, by running the following:
vagrant box add base http://files.vagrantup.com/lucid32.box
It is also possible that you installed the box under a different name (the Vagrant website sometimes refers to lucid32). Instead of downloading a new box, in this case, you can edit Vagrantfile like so, changing the box name to whatever you called it on download:
學校給我一台舊電腦(CPU:Sempron 64 3100+ 1.8Ghz,RAM:512MB)
於是我買了二手RAM:1G*2 300塊含運
電腦就順多了:D
1 2 3 4 f = open("/sys/class/thermal/thermal_zone0/temp","r") for t in f: print "CPU temp:"+t[:2]+"."+t[2:5] f.close()