Month: 八月 2019
教研中心研習:校務行政系統注意事項及常用模組介紹(1080816)
日期:108年8月16日(五)
時間:13:00 – 16:00
地點:教研中心
主題:校務行政系統注意事項及常用模組介紹
講師:邱昭士
公文:
講義:
學習資源:
從範例學程式進階 – Python(1080808, 10)
日期:108年8月8, 10日(四、六)
時間:9:00 – 16:00
地點:樹林國小福祿樓2樓電腦教室
主題:從範例學程式進階 – Python
講師:邱昭士
公文:
Python 入門、開發環境與工具
參考用書:
PyGame
- Pygame 官方網站
- Python遊戲教學
- Python遊戲程式設計(Pygame) – IT閱讀 – ITREAD01.COM
- Invent Your Own Computer Games with Python
- Making Games with Python & Pygame
上課用線上資源及範例:
def oddfn(x): # return x if (x % 2 == 1) else None if x % 2 == 1: return x else: return None
mylist = [5, 10, 15, 20, 25, 30]
filter_object = filter(oddfn, mylist) # 傳回filter object print("奇數串列: ", [item for item in filter_object])
itemlist = [item for item in mylist if oddfn(item)] print("奇數串列: ", itemlist)
itemlist = [] for item in mylist: if oddfn(item): itemlist.append(item) print("奇數串列: ", itemlist)
使用 Python 處理各式文件:
一、處理 Word 文件
- 外掛模組:python-docx
- 下載安裝:pip install python-docx
- 程式導入:import docx
- 線上說明:python-docx documentation
在 python-docx 模組內,將 Word 文件結構分成 3 層:
- Document
- Paragraph
- Run
wdoc = docx.Document('檔案名稱') # 建立 docx 物件 wdoc wdoc.paragraphs wdoc.paragraphs[n].runs wdoc.paragraphs[n].text wdoc.paragraphs[n].runs[m].text
二、處理 PDF 文件
- 外掛模組:PyPDF2
- 下載安裝:pip install PyPDF2
- 程式導入:import PyPDF2
- 線上說明:PyPDF2 Documentation
pdfObj = open('pdf_file', 'rb') # 'rb' 表示以二進位方式開啟 pdfRd = PyPDF2.PdfFileReader(pdfObj) # 讀取 PDF 內容
三、處理 Excel 文件
- 外掛模組:openpyxl
- 下載安裝:pip install openpyxl
- 程式導入:import openpyxl
- 線上說明:A Python library to read/write Excel 2010 xlsx/xlsm files
wb = openpyxl.load_workbook('excel_file') allSheets = wb.get_sheet_names() ws = wb.get_active_sheet() ws = wb.get_sheet_by_name('2020Q3')
四、處理 CSV 文件
- 內建模組
- 程式導入:import csv
- 線上說明: CSV文件讀寫
fn = 'csvReport.csv' with open(fn) as csvFile: csvReader = csv.reader(csvFile) for row in csvReader: print("Row %s = " % csvReader.line_num, row)
fn = 'out20_7.csv' with open(fn, 'w', newline = '') as csvFile: # 開啟csv檔案 csvWriter = csv.writer(csvFile) # 建立Writer物件 csvWriter.writerow(['Name', 'Age', 'City']) csvWriter.writerow(['Hung', '35', 'Taipei']) csvWriter.writerow(['James', '40', 'Chicago'])
網路爬蟲
- 內建模組:webbrowser
- 認識 Google 地圖
- 下載網頁資訊使用外掛模組:requests
- 線上說明:Requests 快速上手
- 解析網頁使用外掛模組:BeautifulSoup
- 網路爬蟲的王者:Selenium
PyGame 範例
PyGame 影音教學 MovingBall
- 程式碼下載:https://github.com/anchiang/MovingBallTutor
- PyGame 教學 MovingBall01:https://youtu.be/1h1zste38c4
- PyGame 教學 MovingBall02:https://youtu.be/DXhpxLjmPHk
- PyGame 教學 MovingBall03:https://youtu.be/oFo2hZUHBDw
學習資源:
- 2018 iT 邦幫忙鐵人賽 – Python自習手札
- 2019 iT 邦幫忙鐵人賽 – Python 30天學習日誌
- 2019 iT 邦幫忙鐵人賽 – Python 自學歷程分享
- Python – 維基百科,自由的百科全書
- VPhysics:Python程式設計和物理的火花碰撞(1060802-0804)
- Python 官方網站
- Python 台灣使用者群組
- Python – 十分鐘入門
- Python 入門 | Django Girls Taipei
- Django Girls 教學手冊 | Django Girls Taipei
- Coding 初學指南-Python – Liang2’s Blog
- 語言技術:Python Gossip
- 專欄文章:Python Tutorial
- Python 慣用語 – 遵循 PEP 8 的命名規則
- inventwithpython.com
- 莫煩Python
Python Library 與第三方程式碼:
- Python 3 Module of the Week
- Pygame 官方網站
- Python遊戲教學
- wxPython 官方網站:Python的GUI toolkit,包裝了知名的C++ GUI toolkit。
- wxPython – 維基百科,自由的百科全書
- Maxkit: 使用wxPython開發跨平台視窗程式
- PyInstaller 官方網站
- pip for Windows
- Pypi:https://pypi.python.org
- github:https://github.com/python
新北市虛擬機房操控原力進化(CentOS)(1080806-07)
日期:108年8月6、7日(二、三)
時間:9:00 – 16:00
地點:樹林國小福祿樓2樓電腦教室
主題:新北市虛擬機房操控原力進化 (CentOS)
講師:林璟豐
公文:
講義:
補充講義:
VMWare CentOS7 虛擬機安裝
- 研習用講義及教材下載:https://ishm.idv.tw/downloads/slps
- IPv6 相關設定指令:https://ishm.idv.tw/?p=297
- 關閉 AutoConfig,其中「乙太網路」須改成使用中的真正網路介面卡名稱:
C:\> netsh interface ipv6 set interface “乙太網路” routerdiscovery=disabled store=persistent - 關閉臨時 IPv6 位址:
C:\> netsh interface ipv6 set privacy state=disabled store=persistent - 設定好,網卡須停用再重新啟用,才會生效。
- 關閉 AutoConfig,其中「乙太網路」須改成使用中的真正網路介面卡名稱:
- 如何在 CentOS console 中正常顯示中、英文:
- LANG=en_US.utf-8
- 查詢 certbot 所在位置:
whereis certbot - 利用 crond 自動更新 Let’s Encrypt 憑證:
# crontab -e
10 1 * * 6 /usr/bin/certbot renew (每週六 1:10 更新一次) - cron table 文件出問題時的修復方法:
# restorecon -r -v /etc/crontab
網路資源:
- 新北市首頁系統操控原力基礎能力(CentOS)(1080805)
- 下載VMware Workstation Player | VMware
- 教研中心研習:新北市政府教育局虛擬機房使用及管理(1080625)
- 教研中心研習:CentOS 系統安裝設定與管理(1071225)
- 教研中心研習:Linux 伺服器建置與管理(CentOS7)(1060327)
- CentOS 官方網站
- [教學] 使用 PuTTYgen 產生 SSH 連線 RSA、DSA 公鑰與私鑰
- [教學 ] 使用 Putty 透過 SSH 連線到 OpenShift 應用程式站台
- [教學] Google Compute Engine ( GCE ) 使用 PuTTY SSH 登入實例
- tcping,一個好用的TCP埠檢測工具
- 業界最強大的SSH客戶機- XSHELL – NetSarang Website
- 鳥哥的Linux 私房菜– 第九章、vim 程式編輯器
- vi 快速入門 – Study-Area
- emacs 快速入門 – Study-Area
- nano (文字編輯器) – 維基百科,自由的百科全書
- Emacs常用指令表
- vi 命令_Linux vi 命令用法詳解
- 鳥哥的Linux 私房菜– 第二十二章、軟體安裝RPM, SRPM 與YUM
- 鳥哥的 Linux 私房菜
- Linux 教程 | 菜鳥教程
- CentOS Linux 7 以firewalld 指令設定防火牆規則教學- G. T. Wang
- Download Visual Studio Code
- TeamViewer 官方網站
- 鳥哥的Linux 私房菜– 第十二章、學習Shell Scripts
- Dig 常用參數 與 DNS 偵錯追蹤
- WinSCP 官方網站
新北市首頁系統操控原力基礎能力(CentOS)(1080805)
日期:108年8月5日(一)
時間:9:00 – 16:00
地點:樹林國小福祿樓2樓電腦教室
主題:新北市首頁系統操控原力基礎能力(CentOS)
講師:林璟豐老師
公文:
講義:
補充講義:
- 研習用講義及教材下載:https://ishm.idv.tw/downloads/slps
- ifdown 網卡名稱:關閉網卡
- ifup 網卡名稱:開啟網卡
網路資源:
- 下載VMware Workstation Player | VMware
- 教研中心研習:新北市政府教育局虛擬機房使用及管理(1080625)
- 教研中心研習:CentOS 系統安裝設定與管理(1071225)
- 教研中心研習:Linux 伺服器建置與管理(CentOS7)(1060327)
- CentOS 官方網站
- [教學] 使用 PuTTYgen 產生 SSH 連線 RSA、DSA 公鑰與私鑰
- [教學 ] 使用 Putty 透過 SSH 連線到 OpenShift 應用程式站台
- [教學] Google Compute Engine ( GCE ) 使用 PuTTY SSH 登入實例
- tcping,一個好用的TCP埠檢測工具
- 業界最強大的SSH客戶機- XSHELL – NetSarang Website
- 鳥哥的Linux 私房菜– 第九章、vim 程式編輯器
- vi 快速入門 – Study-Area
- emacs 快速入門 – Study-Area
- nano (文字編輯器) – 維基百科,自由的百科全書
- Emacs常用指令表
- vi 命令_Linux vi 命令用法詳解
- 鳥哥的Linux 私房菜– 第二十二章、軟體安裝RPM, SRPM 與YUM
- 鳥哥的 Linux 私房菜
- Linux 教程 | 菜鳥教程
- CentOS Linux 7 以firewalld 指令設定防火牆規則教學- G. T. Wang
- Download Visual Studio Code
- TeamViewer 官方網站