zip 是 python 很好用但 用的人卻不多的function
寫 python 時我常常用 zip 把兩個 list 合併成一個 dict ..
dict 要查群時 會方便很多
hours = [x for x in range(0,24)]
Counts = [int(0) for x in range(0,24)]
hourUpCounts = dict(zip(hours,Counts))
hourDownCounts = dict(zip(hours,Counts))
hourSpeed = dict(zip(hours,Counts))
2019年1月23日 星期三
訂閱:
張貼留言 (Atom)
ChartGPT 學 python 很強喔
ChartGPT 最近很紅 , 前一陣子有一些小 module 本來想 google 一下 語法 但發現用 chartGPT 直接請他給 sample code 反而較快 所以只要你有基本 知識 ChartGPT 可以加速你的開發 好用喔
-
我的樹莓派 網路 突然不能用 摻考網路 restart network service 就 ok 了 pi@raspberrypi4:~ $ sudo mii-tool -r eth0 restarting autonegotiation... pi@r...
-
按鈕(Buttons) 是 GUI 中很常用到的元件 按鈕的建置跟上一篇提到很相識, 但多了一個連動的概念以 PyQT 來說就是Signals and Slot (訊號與槽) 葉就是說當我按了一個 Button ( 發射一個訊號) 要執行哪個動作 (到哪個槽) ...
-
最近需要將 Raspberry Pi 收集的資料 統計給別人看 本來是用 GCP 自己收集資料 , 自己寫網頁 但 GCP 費用也不便宜 survey 一下 thing speaker 平台是最簡的單 直接用 https get 就可以將資料上傳到他們的平台了
沒有留言:
張貼留言