Python & MicroPython 程式設計目錄列表
 

stanley 發表在 痞客邦 留言(0) 人氣()

說明如何在7688 Duo 安裝套件
(1) 系統管理套件 -- htop 套件
在Linux原本就可用top來監測系統效能,而htop是加強版,支援滑鼠操作,搜尋,篩選等加強功能。
opkg update 
opkg htop 
然後直接輸入htop來啟動htop, 執行 htop 後,有幾個選項可以操作

stanley 發表在 痞客邦 留言(0) 人氣()

這篇文章所列的問題是針對LinkIt 7688 Duo使用時,我遇到的問題及解決方法,這些問題都是自己實作時遇到的問題,但是在網路上找很久都找不到答案
有些有找到解決方案而有些仍是没有答案的,很奇怪的事大家實作時不是都會遇到的問題,在官方文件或網路上竟然找不到問題及答案,我真疑惑大家是如何實作的,為何没有人遇到這些問題及如何解決這些問題。
(1) LinkIt 7688 Duo 要如何安全關機才不會變磚 ? 
      這個我自己實作電路解決了問題,請參考這篇文章
(2)  LinkIt 7688 Duo 的最大耗電電流是多些,使用7805 IC 可以嗎 ?
  這個我在網路上有找到答案,請參考這篇文章  
       但官方文件有更詳細的說明,在文件的第23頁 
(3)   LinkIt 7688 Duo 的GPIO 接脚可全用嗎? 
       依據官方文件說明 GPIO 0 is occupied by the I2S driver and cannot be used as GPIO function.
  這個還在測試中。 
(4)   LinkIt 7688 Duo 是否可以AP/Station mode 可以共存 ?
  在 firmware v0.9.4 可以使用GUI界面設定,在firmware v0.9.3要使用這篇文章的方法
(5)  LinkIt 7688 Duo當做一個無線Router 
  依據官方文件說明可以達成
(6) LinkIt 7688 Duo 的station mode 可以連接多個MBSSID 嗎? 
  (1) 依據官方文件說明是可以的,但我還在測試中。

stanley 發表在 痞客邦 留言(0) 人氣()

undefined
wemos D1 Mini 腳位

stanley 發表在 痞客邦 留言(0) 人氣()

在實作LinkIt 7688 Duo時,想用一個7805穩壓IC去提供開發版電源,不知道可不可以?
很意外的在網路上竟然没有文件或有人提到LinkIt 7688 Duo需要多少的電流才足夠?
搜索很久才在論壇上有人提到 LinkIt 7688 Duo在開機時大約需要800MA的電流
用7805 IC (依型號提供最大電流大約在於1A或1.5A),因此如使用7805 IC供電, 7805IC 很快就會很熱了,
再加上週邊的其他電路的耗電情形,使用7805 IC 是有點風險或是要注意散熱問題

以上資料提供大家參考,官方好像無正式資料說明這一點
資料來源在
https://forum.seeedstudio.com/t/linkit-7688-power-supply/19012/2 可以看看,謝謝!

stanley 發表在 痞客邦 留言(0) 人氣()

                       我在去年偶然的一次機會開始接觸到獎金獵人這個網站,而在網站中羅列出各種的競賽,其中一個讓我比較有感想參加比賽的是在2018年由臺南市政府經濟發展局所舉辦二天的臺南智慧農創松。主辦單位的最初想法是地球暖化、氣候異常、城鄉落差及農村缺工,我們應該跟農友攜手共創未來。這是我第一次參加的競賽活動,會想參加的原因有三個:

stanley 發表在 痞客邦 留言(0) 人氣()

這是一個建造Django 專案時可參考的目錄及檔案結構,個人建議有如此的圖示會比較簡潔,
參考資料來源為Advanced tutorial: How to write reusable apps 但在這個例子中並無包括資料庫的位置,
ststic 資料夾(存放scripts,js,CSS,images),templates 資料夾存放html

stanley 發表在 痞客邦 留言(0) 人氣()

Python 各種官方說明文件
(1)Beautiful Soup 4.4.0 Documentation
(2)Pandas 0.25.1 documentation 
(3) Django Documentation Release 3.1.dev
 

stanley 發表在 痞客邦 留言(0) 人氣()

(1) 一個基本的範例 擷取檔案且儲存至csv
from collections import OrderedDict
import requests
import pandas as pd
from bs4 import BeautifulSoup
class HTMLTableParser:
def get_html_tables_from_resp(self, html_text):
soup = BeautifulSoup(html_text, 'html.parser')
tables = soup.find_all('table')
return tables
def parse_html_table(self, table):
"""
<tr>
<th align="center" class="tblHead" nowrap="" rowspan="2">產業類別</th>
<th align="center" class="tblHead" nowrap="" rowspan="2">公司代號</th>
<th align="center" class="tblHead" nowrap="" rowspan="2">公司名稱</th>
<th align="center" class="tblHead" colspan="4" nowrap="">非擔任主管職務之<br/>全時員工資訊</th>
<th align="center" class="tblHead" colspan="2" nowrap="">同業公司資訊</th>
<th align="center" class="tblHead" colspan="4" nowrap="">薪資統計情形</th>
</tr>
<tr>
<th align="center" class="tblHead" nowrap="">員工薪資總額(仟元)</th>
<th align="center" class="tblHead" nowrap="">員工人數-加權平均(人)</th>
<th align="center" class="tblHead" nowrap="">員工薪資-平均數(仟元/人)</th>
<th align="center" class="tblHead" nowrap="">每股盈餘(元/股)</th>
<th align="center" class="tblHead" nowrap="">員工薪資-平均數(仟元/人)</th>
<th align="center" class="tblHead" nowrap="">平均每股盈餘(元/股)</th>
<th align="center" class="tblHead" nowrap="">非經理人之<br/>全時員工薪資<br/>平均數未達50萬元</th>
<th align="center" class="tblHead" nowrap="">公司EPS獲利表現較同業為佳<br/>,惟非經理人之全時員工<br/>薪資平均數低於同業水準</th>
<th align="center" class="tblHead" nowrap="">公司EPS較前一年度成長<br/>,惟非經理人之全時員工<br/>薪資平均數較前一年度減少</th>
<th align="center" class="tblHead" nowrap="">公司經營績效與員工薪酬<br/>之關聯性及合理性說明</th>
</tr>
<tr>
<td nowrap="" style="text-align:left !important;">資訊服務業</td>
<td nowrap="" style="text-align:left !important;">8416</td>
<td nowrap="" style="text-align:left !important;">實威</td>
<td nowrap="" style="text-align:right !important;"> 158,636 </td>
<td nowrap="" style="text-align:right !important;"> 186 </td>
<td nowrap="" style="text-align:right !important;"> 853 </td>
<td nowrap="" style="text-align:right !important;"> 9.69 </td>
<td nowrap="" style="text-align:right !important;"> 807 </td>
<td nowrap="" style="text-align:right !important;"> 1.20 </td>
<td nowrap="" style="text-align:right !important;"></td>
<td nowrap="" style="text-align:right !important;"></td>
<td nowrap="" style="text-align:right !important;"></td>
<td nowrap="" style="text-align:left !important;"><br/></td>
</tr>
"""
parsed_data = []
# Find number of rows and columns
# we also find the column titles if we can
table_row_tags = table.find_all('tr')
table_header_tags = table.find_all('th')
column_names = [table_header_tag.get_text() for key, table_header_tag in enumerate(table_header_tags) if key not in (3, 4, 5)]
column_names[7] = '同業公司{}'.format(column_names[7])
column_names[8] = '同業公司{}'.format(column_names[8])
tr_td_tags = [
[td_tag.get_text().strip() for td_tag in table_row.find_all('td')]
for table_row in table_row_tags if table_row.find_all('td')
]
parsed_data = [
OrderedDict({
column_names[index]: td_tag
for index, td_tag in enumerate(tr_td_tag)
})
for tr_td_tag in tr_td_tags
]
df = pd.DataFrame.from_dict(parsed_data)
return df
htlm_parser = HTMLTableParser()
payload = {
# 'encodeURIComponent': 1,
'step': 1,
'firstin': 1,
'TYPEK': 'sii', # sii 上市 / otc 上櫃
'RYEAR': 107,
'code': '',
}
headers = {'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/61.0.3163.100 Safari/537.36'}
resp = requests.post('https://mops.twse.com.tw/mops/web/ajax_t100sb15', data=payload, headers=headers, timeout=2)
html_tables = htlm_parser.get_html_tables_from_resp(resp.text)
df_table = htlm_parser.parse_html_table(html_tables[0])
df_table.to_csv('107_{}.csv'.format(payload['TYPEK']), index=False, encoding='utf-8')
print(df_table)

stanley 發表在 痞客邦 留言(0) 人氣()

(1) 要先安裝 nvm (Node Version Manager) 用來管理多個 Node.js 版本
Linux 開發者
執行以下其中一個既可

stanley 發表在 痞客邦 留言(0) 人氣()

參考資料: http://tw.gitbook.net/sqlite/sqlite_python.html
此網站用來快速查詢SQLlite3的各種指令及用法,這不是資料庫教學,
我是假設讀者是熟知資料庫的語法及運作

stanley 發表在 痞客邦 留言(0) 人氣()


conda命令是管理在安裝不同package時的主要介面,使用conda時,你可以進行建立(create)、輸出(export)、列表(list)、移除(remove)和更新(update)環境於不同Python版本及Packages,同時也可以分享你的虛擬環境。
conda –V

stanley 發表在 痞客邦 留言(0) 人氣()

Blog Stats
⚠️

成人內容提醒

本部落格內容僅限年滿十八歲者瀏覽。
若您未滿十八歲,請立即離開。

已滿十八歲者,亦請勿將內容提供給未成年人士。