發表文章

楊博凱整合開發環境IDE的Jupyter編輯Python程式碼

圖片
Tkinter是Tk GUI工具包的Python繫結包。它是Tk GUI工具包的標準Python介面[3],並且是Python的業界標準GUI工具包。[4]Tkinter同時也包含在Python的Linux、Microsoft Windows和Mac OS X標準庫中。Tkinter的名字來自Tk interface 原始程式碼 python程式碼的空格也是指令, 格相同個空格同一區塊{其他語言括號當區塊} from tkinter import * #從函式庫 tkinter 輸入所有 * 方法export出口 banks=['和家人','摩根大通','美國銀行','中國工商','富國銀行','匯豐銀行','巴黎銀行'] def ABC(): #畫圖 define自訂函數 global b1 #宣告b1是廣域GLOBAL變數,其他函數也可使用 txt = '' for i in range(len(banks)): txt += banks[i] + ' ' b1=Label(canvas,text=txt,font='Arial 20 bold') b1.pack(side=TOP) def XYZ(): #清除視窗的all所有canvas圖 banks.append('三菱銀行') banks.append('台灣銀行') ABC()#結束XYZ之前給它顯示{curly braces, bracket} def kill(): b1.pack_forget() tk = Tk() tk.title("和家人python建立tkinter視窗使用者介面") #也可以定義視窗名為 window, root課本都如此習慣 canvas = Canvas(tk, width=400, height=400) canvas.pack() btn1 = Button(tk, text="楊博凱銀行", co...

楊博凱Javascript與Python比較

圖片
全球市場價值最大的銀行 按鈕PUSH增加 按鈕POP執行自訂函數kill 按鈕POP執行kill呼叫其他函數 CSS也可以in-line 寫在這裡成為網頁的一部分,執行後,可以看到。function kill_SHOW執行二指令 banks.pop()指令移除banks串列的最後一個元素ABC()去執行函數ABC()。P代表paragraph段落 530教學影片 PYTHON練習 banks=['摩根大通','美國銀行','匯豐銀行'] for i in banks: abc = '我是' + i + 'VIP客戶' print(abc) print('劉任昌下次要在專門的系統執行python')

甲楊博凱python串列List(陣列Array),元組Tuple,集合Set,字典Dict

圖片
期中考筆試重點 FONT字型,EM=EMPHASIZE強調。撰寫模式,方便,不專業藉由複習HTML,JAVASCRIPT等,可以順便讓你們了解PYTHON的特色 .SELECTOR{用在多個元素},SPAN拇指與小指的距離,一小段,一小段的文字  UL=UNDERER LIST, OL=ORDERED LIST, LI=LIST  push推,美國餐廳放置餐盤的架子下面是彈簧,取盤子pop,放入盤子push append附加在後面, appendix書本的附錄 大括號{ }CURLY BRACKET , CURLY捲,用於PYTHON集合 中括號[ ]SQUARE BRACKET , SQUARE方形,用於PYTHON串列 小括號( )CIRCLE BRACKET, CIRCLE圓,用於PYTHON元組 角括號<>ANGLE BRACKET ,不能直接打角括號,因為它們是HTML命令,需用&符號接LT(小於Less Then)再分號; 圓周CIRCUMFERENCE, 直徑DIAMETER, 半徑RADIUS BORDER邊界, SOLID實心, PX=PIXEL點  PYTHON與JAVASCRIPT命令的對照 ,PYTHON必須透過編輯器或雲端伺服器(例如GOOGLE COLAB)執行,JAVASCRIPT可以直接在瀏覽器CHROME或EDGE執行  PYTHON指令len(串列)對比JAVASCRIPT串列.length;  PYTHON指令串列 .append(新增) 對比JAVASCRIPT 串列.push(新增) ;傳列 .pop() 移除最後一個元素 BUTTON的 ONCLICK事件 =按下按鈕執行...以最後一個為例,執行kill() 執行JAVASCRIPT的串列迴圈:全球市場價值最大的銀行 全球市場價值最大的銀行 按鈕BUTTON push pop刪除最後一項 CSS也可以in-line

楊博凱PYTHON陣列ARRAY串列LIST字典DIC集合SET元組TUPLE

圖片
利用W3SCHOOLS animal = ["豬", "牛", "羊", '貓', "蛇"] #python語言的註解comments,以下命令出現 print(animal[2]) print(animal[-5]) for i in range(5):#其他語言{}代表一個區 x = '我愛' + animal[i] print(x) #使用index print('上面使用index, 下面沒用') for i in animal: print(i) x = animal.copy() print(animal) x.reverse() #將x反轉reverse print(x) animal.append('狗') print(animal) y = animal.copy() y.reverse() #將x反轉reverse print(y) https://steam.oxxostudio.tw/category/python/info/online-editor.html Google Colab ( Colaboratory ) 是一個在雲端運行的編輯環境,由 Google 提供一個雲端虛擬主機,支援 Python 程式及機器學習 TensorFlow 演算法,Colab 目的在提供教育訓練以及教學研究,不用下載或安裝,就可直接編輯 Python,並使用 Python 的資源庫,大幅降低初學者的入門門檻,不用耗費太多時間在環境的安裝與設定。 在 Colab 裡編輯的程式碼,預設直接儲存在開發者的 Google Drive 雲端硬碟中,執行時由虛擬主機提供強大的運算能力,並不會用到本機的資源。但要如果程式閒置一段時間,會被停止並回收運算資源。 520影片參考519 JUPYTER NOTEBOOK人工智慧平台 心得 UL=UNDERER LIST, OL=ORDERED LIST, LI=LIST 大括號{ }CURLY BRACKET, CURLY捲 中括號[ ]SQUARE BRACKET, SQUA...

楊博凱_HTML_CSS_JavaScript_Python_Java

圖片
簡單計算機 7 8 9 + 4 5 6 - 1 2 3 * 0 C / = 教學影片 FRAME框架SRC=SOURCE來源改成維基百科 維基百科PYTHON說明 python array陣列的方法 Method Description append() Adds an element at the end of the list clear() Removes all the elements from the list copy() Returns a copy of the list count() Returns the number of elements with the specified value extend() Add the elements of a list (or any iterable), to the end of the current list index() Returns the index of the first element with the specified value insert() Adds an element at the specified position pop() Removes the element at the specified position remove() Removes the first item with the specified value reverse() Reverses the order of the list sort() Sorts the list python array方法撰寫模式貼上 ...

楊博凱期末考Math.PI與Math.E放入計算機

楊博凱學習Bro code製作計算機 + 7 8 9 - 4 5 6 * 1 2 3 / 0 . = C ** π e https://www.youtube.com/watch?v=I5kj-YsmWjM Build this JS calculator in 15 minutes!

楊博凱eval()內建函數data type資料型態

楊博凱學習Bro code製作計算機 display.value = eval(display.value) disply的vlue用eval(display.value)取代,算是「字串」運算結果 eval()內建函數(方法) in-line線內設定樣式。readonly唯讀read only。電腦的.的接續術性或函數disply.value面板顯示的內容value值。px=pixel點 + 7 8 9 - 4 5 6 * 1 2 3 / 0 . 算 刪 楊 博 凱 https://www.youtube.com/watch?v=I5kj-YsmWjM Build this JS calculator in 15 minutes!