發表文章

目前顯示的是 5月, 2024的文章

沈甄軒google co-laboratory機器學習

圖片
影片429 維基百科 google機器學習實驗 https://colab.research.google.com/

沈甄軒eval=evaluate函數calculator美國男生印度女生,調色板

圖片
w3schools eval()美國男生Bro Code from tkinter import * def button_press(num): global equation_text equation_text = equation_text + str(num) equation_label.set(equation_text) def equals(): global equation_text try: total = str(eval(equation_text)) equation_label.set(total) equation_text = total except SyntaxError: equation_label.set("syntax error") equation_text = "" except ZeroDivisionError: equation_label.set("arithmetic error") equation_text = "" def clear(): global equation_text equation_label.set("") equation_text = "" window = Tk() window.title("沈甄軒計算機calculator") window.geometry("500x500") equation_text = "" equation_label = StringVar() label = Label(window, textvariable=equation_label, font=('consolas',20), bg="white", width=24, height=2) label.pack() frame = Frame(...

沈甄軒python視窗Toplevel與Tk

圖片

劉任昌tkinter迴圈字串格式%d

圖片
from tkinter import * #下載程式碼,從tkinter輸入所有函式 import time x=['\U0001F600','\U0001F609','\U0001F602','\U0001F603','\U0001F604'] for i in range(5): window = Tk() #建構視窗,名為window建構一個房子 window.title('沈甄軒的python視窗') window.geometry('300x300+%d+0' % (300*i)) b1=Label(window,text=x[i],font='Arial 300 bold').pack() time.sleep(0.2) window.update() window.mainloop()

沈甄軒tkinter套件建立圖形使用者介面GUI=Graphical User Interface

圖片
from tkinter import * #下載程式碼,從tkinter輸入所有函式 window = Tk() #建構視窗,名為window建構一個房子 window.title('沈甄軒的python視窗') window.geometry('500x500+0+0') b1=Label(window,text='\U0001F600',font='Arial 300 bold').pack() window1 = Tk() #建構視窗,名為window建構一個房子 window1.title('沈甄軒的python視窗') window1.geometry('500x500+500+0') b1=Label(window1,text='\U0001F601',font='Arial 300 bold').pack() window2 = Tk() #建構視窗,名為window建構一個房子 window2.title('沈甄軒的python視窗') window2.geometry('500x500+0+500') b1=Label(window2,text='\U0001F602',font='Arial 300 bold').pack() window.mainloop()