譚惟心python import openpyxl 處理EXCEL
import openpyxl #譚惟心輸入import openpyxl處理EXCEL的函式庫
book = openpyxl.load_workbook(r'wb.xlsx') #開啟EXCEL工作簿wb.xlsx print("1. 列出所有工作表名稱") sheetNames=book.sheetnames #所有工作表的集合 for name in sheetNames: print(name) print("2. 針對特定工作表, 列出前面數列") #sheet = book["python"] #for row in sheet.iter_rows(min_row=1, max_row=3, min_col=1, max_col=5, values_only=True): # print(row) print("3. 列出工作表所有內容") #sheet["F1"], sheet["G1"], sheet["H1"], sheet["I1"]="波段H","波段L","部位","損益" #sheet["F2"], sheet["G2"], sheet["H2"], sheet["I2"]=sheet["C2"].value, sheet["D2"].value, 0, 0 #for row in sheet.iter_rows(min_row=1, max_row=3, min_col=1, max_col=9, values_only=True): # print(row) #book.save()
from tkinter import *
import pygame
root = Tk()
root.title("譚惟心")
root.geometry("500x400")
pygame.mixer.init()
def play():
pygame.mixer.music.load('mixkit-tech-house-vibes-130.mp3')
pygame.mixer.music.play(loops=0)
def stop():
pygame.mixer.music.stop()
my_button = Button(root, text=("演奏"), command=play)
my_button.pack(pady=20)
stop_button = Button(root, text="停止", command=stop)
stop_button.pack(pady=20)
root.mainloop()
# www.pygame.org
#pip install -U pygame==2.4.0 --user
留言
張貼留言