温曼然學會HTML與CSS與嵌入影片等 取得連結 Facebook X Pinterest 以電子郵件傳送 其他應用程式 9月 11, 2023 温曼然學習內容 在記事本編譯程式碼,然後用瀏覽器打開。 寫程式碼用編譯氣,然後用編譯器或直譯器執行 第一堂課:學會HTML與CSS 學習指令 iframe框架,width寬度,height高度,src=cource來源,title標題 html, css, styie, border, solid, color,style="border:10px red solid" 取得連結 Facebook X Pinterest 以電子郵件傳送 其他應用程式 留言 George2023年10月20日 上午11:11912確實練習回覆刪除回覆回覆新增留言載入更多… 張貼留言
温曼然bro code貪吃蛇import module教育學習網 6月 12, 2024 https://steam.oxxostudio.tw/category/python/basic/import.html 匯入模組 import Module 在 Python 裡,「模組」是一個存在於任意程式碼中的檔案,任何 Python 的程式碼也都可以當作模組使用,透過 import 陳述式,可以引用其他模組的程式碼,進一步使用其他模組的程式和變數,讓程式更精簡更好維護。 改寫自bro code貪吃蛇 from tkinter import * import random #亂數模組 GAME_WIDTH , GAME_HEIGHT = 1000 , 800 SPEED = 200 #時間單位是千分之一秒 SPACE_SIZE , BODY_PARTS = 50 , 3 #左邊變數 assigning value SNAKE_COLOR = "green" FOOD_COLOR = [ 'pink' , 'yellow' , 'orange' , 'tomato' ] #改成串列可以選擇 BACKGROUND_COLOR = "black" class Snake : def __init__ ( self ): self . body_size = BODY_PARTS self . coordinates = [] self . squares = [] for i in range ( 0 , BODY_PARTS ): self . coordinates . append ([ 0 , 0 ]) for x , y in self . coordinates : square = canvas . create_rectang... 閱讀完整內容
温曼然eval函數圖形介面計算機 5月 22, 2024 美國計算機 印度計算機 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('温曼然拷貝美國人的程式碼') 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(window) frame.pack() button1 = B... 閱讀完整內容
温曼然python視窗Toplevel與Tk 5月 15, 2024 5月 15, 2024 from tkinter import * #從tkinter函式庫輸入所有函式,檔案'window001.py' import time #412單元延續數入time套件 def delete(): #增加自訂函數def delete() List[int(n.get())-1].destroy() #destroy破壞視窗List[索引] win.config(bg='#1099ff') b1=Label(win,text='温曼然',font='Arial 100 bold',bg='#10ff10').pack() x=('林','青','霞','💩','\U0001F609','\U0001F4ff') #建立元祖tuple名為x,0,1,2,3,4,5 List = [] #建立串列list名為List win=Tk() #建構子constrctor Tk, Toplevel win.geometry('400x200+800+0') win.title('温曼然的視窗') n = StringVar(win) #類別變數 n.set('刪除') op1 = OptionMenu(win,n,1,2,3,4,5,6).pack(side=LEFT) bu1 = Button(win,text='刪除選取視窗',command=delete,font='20',bg='blue',fg='white') bu1.pack() for i in range(6): window = Toplevel() window.title('温曼然第%d個視窗' % (i+1)) window.geometry('300x300+%d+%d' % (i*300,i*100)) window.config(bg=... 閱讀完整內容
912確實練習
回覆刪除