# Python 金融思辨 - 理財菁英實作營 ###### tags: `NeverClassroom` `金融思辨` [TOC] ## 貨幣經濟學 - 探究貨幣的由來、國際金融關係 * 貨幣經濟學在於探討**金錢的本質** * 經濟,簡單來說就是交易 * 分工利益 * 資源分配 * 供需關係 * 眾人認定的價值之物 - 貨幣誕生 * 古代中國銅錢、古羅馬貝殼 * 銀行的誕生: 以兌換、保管貴重物品、匯兌等為業 * 牛頓 * 17世紀的英國先後陷入內戰、反荷戰爭和反法戰爭。鑄幣局內部鑄造劣幣。 * 公信力破産,人們紛紛拋出銀幣換取黃金 * 銀本位慢慢轉變為金銀雙本位 * 金銀的交換比例導致英國大量銀幣流失 * 金本位誕生 * 不列顛森林體系 * 二戰後,確立美金地位 * 成立國際貨幣基金(IMF) * **信用貨幣的誕生** * 越戰泥淖,尼克森放棄金本位 * 通貨膨脹、通貨緊縮 * 貨幣數量理論: 貨幣總量 會嚴重影響物價 * 匯率 * 國際間發展了購買力平價理論作為決定合理匯率的依據 * 經濟學人發明巨無霸指數(Big Mac index) * 固定匯率 V.S. 浮動匯率 ## 程式基礎 - 初見 Python * 電腦(Computer)的發明就是為了做計算(compute) * 計算所需的兩個要素 * 資料 * 運算方式(指令) * 寫程式(coding) 就是「撰寫指令來讓電腦運作」 * 指令我們通常寫成一個一個函數(function)來實現任務 ![](https://i.imgur.com/QwMmfmp.png) * function 有 input & output 兩個概念 * 第一個函數 ```python=1 print('Hi! 我開始寫 Python 程式了!') ``` :::info 輸入 'Hi! 我開始寫 Python 程式了!',沒有輸出 效果是印出東西 ::: * 資料的類型可以粗分兩大類 * 數字 * 文字(我們會稱它為**字串**) ```python=1 # 數字 1, 2, 5, 9, 14, 6.7, 9.2 # 文字 '我是字串', "我也是字串", '真巧我也是XD', 'shut up!' ``` * 數字又分成**整數**與**浮點數** ```python=1 # 我是整數 n1 = 1 # 我是浮點數 n2 = 1.3 n3 = .7 ``` * 什麼都可以餵給 `print` ```python=1 print(8.3) print('Hello world') print('彥鈞老師帥') ``` * 這些資料是什麼意思? 讓我們給它們名字! * **變數**的意義就在於賦予資料辨認的方式 ```python=1 name = 'Jim' age = 18 grade = 98 ``` * 文字與數字處理方式一樣嗎? ```python=1 print('8'+'9') print(8+9) print('8'*5) print(8*5) ``` * 數字與文字可以互相轉換? ```python=1 tmp1 = 8 tmp2 = str(8) print(9+tmp1) print("9"+tmp2) ``` * 第二個函數 - 來增加一些互動吧! ```python=1 name = input('Please input your name:') print('Hello! ' + name + ', welcome to the world of programming.') ``` * 讓電腦看起來有點腦子進行判斷 ```python=1 name = input('Please input your name:') if (name == 'Jim'): print('Welcome!') else: print('Get out!') ``` * 自己來寫一個函數吧! ```python=1 def hello(): print('Hello! Python!') hello() ``` ```python=1 def add(n, m): return n+m a = 1 b = 2 c = add(a, b) print(c) ``` :::info 上述的 a, b, n, m 的關係是? ::: ## 會計實務 - 財務基本概念 * 凡是經濟體,一定都具備兩大觀念 * 流量 * 存量 :::info 可以把經濟體當作是儲存金錢的容器 ::: * 流量分為 * 收入 * 支出 * 存量分為 * 資產 * 負債 * 理財的第一步 - 記帳 * 了解金錢的流向 * 主要分為四種方法 * 流水帳記帳法 * 消浪投記帳法 * 目標儲蓄法 * 預算控制法 ## 程式基礎 - Tkinter * [Example icon](https://drive.google.com/file/d/1VzmHkNczP-KK4b65KnCOqZfJd_2nRV97/view?usp=sharing) * 使用 `module` 來幫助我們開發吧! * 創建一個視窗開始 ```python=1 import tkinter as tk win = tk.Tk() win.title("test") win.iconbitmap("logo.ico") win.configure(bg="black") win.geometry("300x200") win.mainloop() ``` ![](https://i.imgur.com/RRytiam.png =300x) * Label ```python=1 l1=tk.Label(win,text="哈哈",bg="blue",fg="white",width=8,font=("微軟正黑體",12,"bold")) l1.pack() ``` ![](https://i.imgur.com/kBxN9tE.png =300x) * Button ```python=1 b1=tk.Button(win,text="Push",bg="yellow",fg="black",bd=4) b1.pack() ``` ![](https://i.imgur.com/CTRMfTc.png =300x) * Entry ```python=1 e1=tk.Entry(win,width=20,bg="yellow",fg="black",show="*") e1.pack() ``` ![](https://i.imgur.com/04RaxEw.png =300x) * Combobox ```python=1 from tkinter import ttk list1 = ttk.Combobox(win, values=["第一", "no.2","the third"],width=5) list1.pack() list1.current(1) ``` ![](https://i.imgur.com/hra4FYk.png =300x) * Radiobutton ```python=1 tmp = tk.StringVar() b1 = tk.Radiobutton(win,text='第一項',variable=tmp,value='A',bg="#0f4c81",fg="white",selectcolor="#131F39",font=("微軟正黑體",10)) b1.pack(side='left') b2 = tk.Radiobutton(win,text='no.2',variable=tmp,value='B',bg="#0f4c81",fg="white",selectcolor="#131F39",font=("微軟正黑體",10)) b2.pack(side='left') b3 = tk.Radiobutton(win,text='the third',variable=tmp,value='C',bg="#0f4c81",fg="white",selectcolor="#131F39",font=("微軟正黑體",10)) b3.pack(side='left') b3.select() ``` ![](https://i.imgur.com/jFMTUct.png =300x) * Scale ```python=1 s1=tk.Scale(win,highlightbackground="#FF8D00",activebackground="white",to=2,bg="#FF8D00",troughcolor="#FF8D00",showvalue=False,orient=tk.HORIZONTAL,length=80,sliderlength=30) s1.pack() ``` ![](https://i.imgur.com/B7x2zz1.png =300x) * PhotoImage ```python=1 photoJP = tk.PhotoImage(file="japan.png") imgLabel = tk.Label(win,image=photoJP) imgLabel.pack() ``` ![](https://i.imgur.com/mVNPZQy.png =300x) * 參考作品 - [新台幣&日元轉換器](https://hackmd.io/8O3QySshSaCn06kiyoef0A?view) ![](https://i.imgur.com/2ltzsOx.gif =300x) * 參考作品 - [台美日轉換器 with 列表](https://hackmd.io/Gbr2hgtPTQeCINBbwvdpOA) ![](https://i.imgur.com/dC2Xg1e.gif =300x) * 參考作品 - [台美日轉換器 with 勾選](https://hackmd.io/Cx1nGHYLTlu8oHxjJTIbYA) ![](https://i.imgur.com/Qm99nIx.gif =300x) * 參考作品 - [台美日轉換器 with 滑軌](https://hackmd.io/o4UNLCNOTWWMZmt7iylZ0A) ![](https://i.imgur.com/KiJkwIp.gif =300x) * 參考作品 - [流水帳記帳法](https://hackmd.io/XI1EkN0bRymYayM-vluf_g) ![](https://i.imgur.com/CxbKIZN.gif =300x) * 參考作品 - [消浪投記帳法](https://hackmd.io/RTiDn_1jQHWn3erBYKtBRA) ![](https://i.imgur.com/KtCoSPg.gif =300x) * 參考作品 - [目標儲蓄法](https://hackmd.io/KZq4MyhgSuCYKBv-ic_mVw) ![](https://i.imgur.com/HIdXp3R.gif =300x) * 參考作品 - [預算控制法](https://hackmd.io/NOqgULHKTCS1AVAz1NQ_2A) ![](https://i.imgur.com/7hSYKnT.gif =300x) ## 會計實務 - 財務報表 * 東北有三寶,人蔘貂皮烏拉草;會計有三寶: * 損益表 * 資產負債表 * 現金流量表 * **損益表** 代表著一個企業營運活動的收入支出細項 ![](https://i.imgur.com/9MeEP50.png =300x) * **資產負債表** 代表著一個企業目前財務狀況是否穩健 ![](https://i.imgur.com/LvwSWC9.png =300x) * **現金流量表** 則綜合了企業的營運、投資以及融資活動的現金總變動 ![](https://i.imgur.com/yUooRRD.png =300x) ## 哲思議題 ## 經理人大會師 https://hackmd.io/cSNCe3LEQJOkW7hsqYEfxg?view ![](https://hackmd.io/E9IgMGVNRYOvdLZ-0TlOag) ## 課後回饋 [請按我](https://forms.gle/NFZJjDJAD9xMysXP7) ## Reference - 如何製作自己的 icon ### Step1. 找到適合的圖片 ![](https://i.imgur.com/IxIgtGa.png) ### Step1.5 想修圖使用小畫家或 photopea ![](https://i.imgur.com/wGSNEoH.png) ### Step2. 轉成 ico ![](https://i.imgur.com/OiVb3Lk.png)