2025年8月28日 星期四

只要點兩下就能利用彰化縣EIP系統學生帳號CSV產出建立Google Classroom 學生總表

系列文章:
1.只要點兩下就能產出彰化縣Cloud School 學生帳號密碼匯入彰化縣EIP系統學生帳號密碼的CSV
1.https://skjhcreator.blogspot.com/2025/08/cloud-school-eipcsv.html
2.只要點兩下就能利用彰化縣EIP系統學生帳號CSV產出建立Google Classroom 學生總表
2.https://skjhcreator.blogspot.com/2025/08/eipcsvgoogle-classroom.html 
3.
只要點兩下就能利用彰化縣EIP系統學生帳號CSV產出指定學生名單的Google Classroom學生帳號總表
3.https://skjhcreator.blogspot.com/2025/09/eipcsvgoogle-classroom.html

        彰化縣數位學習師生單一帳號系統(EIP=Enterprise Information Portal)於2025年7月7日正式啟用。我要如何利用EIP系統學生帳號CSV來建立Google Classroom 後,將各班的學生加入。或是給老師一張學生帳號總表,讓老師自行建立Classroom,然後將學生加入。由於EIP系統學生帳號只有帳號,沒有後面的@chc.edu.tw。還要想辦法將@chc.edu.tw加入。但問題是用Excel開啟CSV,學生帳號只有數字,在Excel 格式就會跑掉。比方說學生帳號0432579,在Excel,就會變成432579。若用記事本開,學生帳號"0432579",完全沒法用尋找、取代等方式來簡單完成。就要複製@chc.edu.tw,然後一個個貼上。

1.EIP學生帳號下載方式:
下載的學生資料檔名為學校代碼_學生資料_日期時間.CSV,其格式如下:


下載檔案解壓密碼:demo1234
Here is the website where you can download the program and find instructions:
Download。Extraction Password: demo1234
使用教學(Instructional videos):



以下是開發過程與原始碼 (Development process and code):
程式名稱(Program name):pyEIP2GoogleClassRoomStudentAccount.py
程式內容(Code):
import csv
import os

# 取得目前的工作目錄
current_directory = os.getcwd()
# 取得目前的工作目錄內input
current_directory_input = current_directory+"\\input\\"
#  取得工作目錄input內所有檔案名稱
current_directory_input_files = os.listdir(current_directory_input)

# 以副檔名來判斷設定相對應的檔案
for i in current_directory_input_files:
    TempFileName,TempFileExtension = os.path.splitext(i)
    if TempFileExtension == ".csv":
        TempCSVFile = i
    elif TempFileExtension == ".xlsx":
        TempXLSXFile = i
    else:
        TempTXT = i

# 設定CSVList為一個 list
CSVList = []
# 開啟 CSV 檔案
with open(current_directory_input+TempCSVFile, mode='r', encoding='utf-8') as file:
    # 建立 CSV 讀取器
    reader = csv.reader(file)
    # 逐行讀取 CSV 檔案內容
    for row in reader:
        CSVList.append(row)

# CSVListTitle 取得 CSVList[0]
CSVListTitle = CSVList[0]
# 刪除CSVList[0]
CSVList.pop(0)
# 對CSVList 進行排序
CSVList.sort(key=lambda x: x[0])
ResultList = []
ResultList.append(CSVListTitle)

for j in CSVList:
    ResultList.append([str(j[0]),str(j[1])+"@chc.edu.tw"])
               
with open(current_directory+"\\EIP2GoogleClassRoomStudentAccount.csv", mode="w", newline="", encoding="utf-8") as file:
    writer = csv.writer(file)
    writer.writerows(ResultList)

print("EIP2GoogleClassRoomStudentAccount.csv 檔案已成功寫入!")

資料來源:

沒有留言:

張貼留言

只要點兩下兩次,就能依照設定拆分指定PDF頁數並合併成設定好的一個PDF

        最近遇到一個問題,想要對四個不同的PDF,分別擷取1~2頁、3~4頁、5~6頁、7~8頁,合併成一個總共8頁的PDF。那該怎麼寫程式來處理這件事呢?那如果是用線上拆分PDF網頁與線上合併PDF網頁,該怎麼做呢?則是需要將四個不同PDF分別上傳到拆分網頁後再 一頁一...