<style>
.reveal {
font-size: 30px;
}
.reveal h1 {
font-size: 42px;
}
</style>
# NCKU ES Python 視覺化
###### tags:`NCKU_ES` `python lecture`
---
# Before We Start
----

----

----
<img src=https://i.redd.it/i0imk0ay05k21.jpg style="height:500px">
----
<img src=https://i.imgur.com/bPkuNPu.png style="height:500px">
----

----
<img src=https://i.redd.it/37xqk9umycn31.jpg style="height:500px">
---
# Object Orientation 物件導向程式設計
----
## What is the difference between `sequential orientation` and `object orientation` ?
----
## What is the concept of `class` ?
### 將細節包裝起來
### `抽象` 的概念
----
## 對資料作處理,而非對單一的變數做處理
---
# Python 簡介
----
- Python 又被稱為「膠水語言」,Python能夠將其他語言編寫的程式進行整合。
- 最適合初學者入門的語言。
- 高互動性與跨平台特性。
----
## 直譯程式 v.s. 編譯程式
||直譯語言|編譯語言|
|:----:|:----:|:----:|
|內容|利用直譯器 interpretor 將程式碼一行一行解析與執行。多為動態語言|編譯器(Compiler)將程式碼轉化為機器碼,編譯過程中編譯器會進行型別檢查、偵錯、最佳化等,多為靜態語言。|
|特色|程式碼較靈活、程式彈性高、執行速度相對較慢|高效能|
|常見| JavaScript、Python、Ruby|C、C++|
----
## The Zen of Python (Python 之禪)
試著在 IDLE 或是任何 Python 執行環境輸入以下程式碼:
```python=
import this
```
[Citation](https://zh.wikipedia.org/wiki/Python%E4%B9%8B%E7%A6%85)
>優美優於醜陋,
明瞭優於隱晦;
簡單優於複雜,
複雜優於凌亂,
扁平優於嵌套,
稀疏優於稠密,
可讀性很重要!
即使實用比純粹更優,
特例亦不可違背原則。
錯誤絕不能悄悄忽略,
除非它明確需要如此。
面對不確定性,
拒絕妄加猜測。
任何問題應有一種,
且最好只有一種,
顯而易見的解決方法。
儘管這方法一開始並非如此直觀,
除非你是荷蘭人。
做優於不做,
然而不假思索還不如不做。
很難解釋的,必然是壞方法。
很好解釋的,可能是好方法。
命名空間是個絕妙的主意,
我們應好好利用它。
----
## 程式碼結構
- 沒有特定的程式進入點
- 變數宣告不須 keyword
### 註解
```python=
"""
註解一 (多行)
"""
'''
註解一 (多行)
'''
# 註解三 (單行)
```
----
### 縮排
在 C/C++ 中,使用 {} 表示區塊 (block) ,在 python 中使用 tab 或 space 來表示。
:::warning
tab 和 space 在一整份檔案中只能擇一使用! 否則執行時會出現 indentation error
:::
### 冒號
在 `if` 、 `else` 、 `for` 、 `while` 等 function 後,用冒號表示開始一個新的區段。
----
### 基本資料型態
- 變數
- Numbers
- String
- Lists
- Dictionaries (dict)
```python=
pet = 'Tuzki'
number = 123
list1 = ['hello', 'world', 123]
dict1 = {'name':'Amy',
'color':'green'}
```
---
## Virtual environment
和別人一起開發專案的實用技巧 - 虛擬環境
>「做 Python Project 不用 Pipenv 會下地獄ㄛ!」
「控制該語言的使用版本」以及「控制使用的套件版本」如果大家用的版本都不一樣就天下大亂了!
[這裡](https://hackmd.io/@yencheng/r1yzqakKv)
---
# 火力展示
----
## 語音辨識 (Speech To Text, STT)
[之前寫的東西在這裡就不重貼了XD](https://hackmd.io/wpxyUyi4QsCsE2-22LvqQw?both#%E8%AA%9E%E9%9F%B3%E8%BE%A8%E8%AD%98-STT)
---
----
{"metaMigratedAt":"2023-06-15T15:16:17.876Z","metaMigratedFrom":"YAML","title":"NCKU ES Python 部課 - Intro","breaks":true,"slideOptions":"{\"theme\":\"League\",\"transition\":\"fade\",\"spotlight\":{\"enabled\":false},\"slideNumber\":true,\"parallaxBackgroundImage\":\"https://wallpaperboat.com/wp-content/uploads/2019/10/programming-02.jpg\"}","contributors":"[{\"id\":\"af67681e-fb2e-4298-8e92-448b36d346a6\",\"add\":2568,\"del\":91},{\"id\":\"107517ab-bb77-4b32-b500-83c1d1c65e0f\",\"add\":218,\"del\":0}]"}