蘇奕翰
    • Create new note
    • Create a note from template
      • Sharing URL Link copied
      • /edit
      • View mode
        • Edit mode
        • View mode
        • Book mode
        • Slide mode
        Edit mode View mode Book mode Slide mode
      • Customize slides
      • Note Permission
      • Read
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Write
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Engagement control Commenting, Suggest edit, Emoji Reply
    • Invite by email
      Invitee

      This note has no invitees

    • Publish Note

      Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

      Your note will be visible on your profile and discoverable by anyone.
      Your note is now live.
      This note is visible on your profile and discoverable online.
      Everyone on the web can find and read all notes of this public team.
      See published notes
      Unpublish note
      Please check the box to agree to the Community Guidelines.
      View profile
    • Commenting
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
      • Everyone
    • Suggest edit
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
    • Emoji Reply
    • Enable
    • Versions and GitHub Sync
    • Note settings
    • Note Insights
    • Engagement control
    • Transfer ownership
    • Delete this note
    • Save as template
    • Insert from template
    • Import from
      • Dropbox
      • Google Drive
      • Gist
      • Clipboard
    • Export to
      • Dropbox
      • Google Drive
      • Gist
    • Download
      • Markdown
      • HTML
      • Raw HTML
Menu Note settings Versions and GitHub Sync Note Insights Sharing URL Create Help
Create Create new note Create a note from template
Menu
Options
Engagement control Transfer ownership Delete this note
Import from
Dropbox Google Drive Gist Clipboard
Export to
Dropbox Google Drive Gist
Download
Markdown HTML Raw HTML
Back
Sharing URL Link copied
/edit
View mode
  • Edit mode
  • View mode
  • Book mode
  • Slide mode
Edit mode View mode Book mode Slide mode
Customize slides
Note Permission
Read
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Write
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Engagement control Commenting, Suggest edit, Emoji Reply
  • Invite by email
    Invitee

    This note has no invitees

  • Publish Note

    Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

    Your note will be visible on your profile and discoverable by anyone.
    Your note is now live.
    This note is visible on your profile and discoverable online.
    Everyone on the web can find and read all notes of this public team.
    See published notes
    Unpublish note
    Please check the box to agree to the Community Guidelines.
    View profile
    Engagement control
    Commenting
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    • Everyone
    Suggest edit
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    Emoji Reply
    Enable
    Import from Dropbox Google Drive Gist Clipboard
       owned this note    owned this note      
    Published Linked with GitHub
    Subscribed
    • Any changes
      Be notified of any changes
    • Mention me
      Be notified of mention me
    • Unsubscribe
    Subscribe
    # Python 初學者使用手冊 --- Author : 蘇奕翰 s1000210hank@icloud.com <br> :::info **早安 這是 python 的使用手冊** **下面會有安裝教學 以及一些簡單的入門教學** **總之 加油www** ::: --- [toc] # 初始安裝 (for Windows) ## 必要軟體 ### miniconda :::warning **這個是 anaconda 的輕量化版本 大部分要用的 package 都要自己安裝 而好用的軟體 spyder, jupyter 也是要自己安裝** \ **這是一個可以安裝 python 以及 python 套件(package) 的平台** ::: --- 1. 由以下網址下載 **miniconda** 64位元版(除非系統僅支援32位元) https://docs.conda.io/en/latest/miniconda.html 下載 python 第幾版皆可 可以先上網尋找各版本的差異 基本上不選擇 2.7版 python2與python3差異大且不相容 ![](https://i.imgur.com/Y0NdOmd.png) 2. 雙擊後就可以開始安裝 一路按 `next` 若須更改安裝位置 如下圖 ![](https://i.imgur.com/b2AqAv5.png) 3. 到這邊時 **務必務必** 要把上面那個勾勾按下去 要把 `conda` 設定為 **系統環境變數** 不然就要手動加入 [超麻煩](https://bmtnote.blogspot.com/2019/05/windowsanacondapath.html) ![](https://i.imgur.com/1l6ZeRe.png) 4. 安裝完成後 跑出下面的選項 那只是引導你去看他們的網站而已 有沒有勾都沒差 ![](https://i.imgur.com/6uumnwf.png) ## 非必要軟體 ### notepad++ :::warning **notepad++(npp) 是一個記事本 只是他是一個很厲害很厲害的記事本 基本上他很適合拿來打 code 也支援許多語言的 [語法高亮](https://zh.wikipedia.org/wiki/%E8%AA%9E%E6%B3%95%E7%AA%81%E9%A1%AF)** \ **本身有許許多多的外掛套件可以使用 有的用來執行程式 有的方便程式碼的構築 只是在調整成你想要的形狀以前 他都非常陽春 需要花時間去理解去更改他的樣子 基本上 裡面看到的所有顏色都可以調整** ::: --- 1. 由以下網址下載 建議下載 32位元版 有較多外掛套件支援 https://notepad-plus-plus.org/downloads/ ![](https://i.imgur.com/5wPuNad.png) 2. 因為有很多東西可以調整 這邊只介紹幾個簡單的東西 * 語言 這邊指的是程式語言 不同的程式語言有不同的語法高亮 ![](https://i.imgur.com/HZN4uZp.png) * 設定>>程式語言格式 可以調整語法高亮的顏色以及背景色 或是加入關鍵字 ![](https://i.imgur.com/uP8bNrp.png) * 設定>>管理快捷鍵... 因為有很多的外掛會需要用到快捷鍵 這邊可以編輯快捷鍵 避免外掛與原生指令衝突 ![](https://i.imgur.com/Gu7KL1t.png) * 外掛>>外掛模組管理 下載安裝各種外掛的地方 ![](https://i.imgur.com/w7dec2o.png) 3. 常用外掛模組介紹 * Light Explorer 輕量化的檔案瀏覽 ![](https://i.imgur.com/6uffR9W.png) * NppFTP 可以連線至其他主機 且可以將檔案下載更改後自行上傳 ![](https://i.imgur.com/0dudovS.png) * QuickText 辨認特定文字(Tags)後 自動完成一行至多行的文字(Substitution Text) ![](https://i.imgur.com/HBlGxd2.png) * PyNPP 用來跑 python 的外掛 需要在 Options 中設定好 python.exe 的路徑 ![](https://i.imgur.com/igg7jjS.png) * TagsView 可以瞬移到某個 function 或 class 對於大型的code而言很方便 ![](https://i.imgur.com/GmZ0sir.png) * Quick Color Picker + 我覺得最最最炫砲的外掛 挑選色碼的福音 這個外掛只需要雙擊色碼就可以叫出選顏色的小視窗 甚至可以挑選螢幕上的其他顏色 ![](https://i.imgur.com/rJzLfZc.png) ### VS code, Sublime :::warning **這些都是用來打 code 非常方便的軟體 網路上也有許多教學文章 也很推薦大家嘗試看看** ::: ### Windows Terminal :::warning **與命令提示字元(cmd)是一樣的東西 只是介面更改的彈性較大 使用起來也較為方便 甚至可以開啟分頁進行多工處理 這是他們的[官網](https://docs.microsoft.com/zh-tw/windows/terminal/get-started)** ::: --- 1. 在 Microsoft Store 中下載 2. 搜尋 Windows Terminal 即可 3. 隨便在某個資料夾的路徑欄中打 `wt -d.` 即可在該位置開啟 windows terminal ![](https://i.imgur.com/mhAqdA7.png) # 從 conda 開始 :::warning **如同前面的介紹 這是一個可以用來管理 python 套件的平台 無論是要新增虛擬環境或是安裝套件都可以使用 conda 僅能安裝 2~3成的套件 剩下的都只能使用 pip進行安裝 (詳見[好文推薦 : conda vs pip](#好文推薦)) 不過大部分會用到的套件都可以使用 conda 安裝 所以也不用太過於擔心XD** ::: --- ## 檔案下載 1. [於此連結下載必要檔案](https://drive.google.com/file/d/1Pbf6LyyfUDABVX_VmojkegUoN4TfR2Uh/view?usp=sharing) 2. 在桌面解壓縮 內含 `install.txt` 以及 `test.py` --- ## 進行測試 1. 開啟你的 命令提示字元 * `window + R` 後輸入 `cmd` * 在路徑欄輸入 `wt` 2. 輸入 `cd %USERPROFILE%\Desktop` ==移動至桌面== 3. 輸入 `conda -V` 確認 conda 的版本 * 若此時無法使用 可能是 conda 尚未加入系統環境變數 詳見[此篇](https://bmtnote.blogspot.com/2019/05/windowsanacondapath.html) 4. 輸入 `python` 確認 python 可以開啟 * 若此時無法使用 可能是 conda 尚未加入系統環境變數 詳見[此篇](https://bmtnote.blogspot.com/2019/05/windowsanacondapath.html) 5. `ctrl + Z` 然後按下 `enter` 離開 pyhton 6. 輸入 `conda update conda -y` 更新 conda 至最新版 7. 輸入 `conda install -c conda-forge --file install.txt -y` 安裝套件 8. 輸入 `python test.py` * 若套件安裝成功 會跑出一些話以及一張圖 別擔心 圖3秒鐘就會消失 * 安裝失敗的話 我也不確定出了哪些問題 要看到跑出來的 error 才能確定 9. 關掉 命令提示字元 10. 在搜尋中打 `spyder` 並開啟 * 理論上他是打得開的 如果無法開啟 則嘗試重新開機後再繼續 還是不行就 試試看在命令提示字元中輸入 `conda update spyder` 11. 上面都完成後 就已經準備好可以開始寫 python 了 加油www --- ### 簡單介紹 spyder :::warning **spyder 功能太方便 太強大 可以自動debug 自動補完 自動找尋相關程式碼 還可以在右下角即時看到程式碼運行狀況 或是右上角的變數表以及即時確認資料視覺化的成果 可以很方便地確認資料是否正確 好好的使用可以節省你不少時間 \ 不過我跟 spyder 不是很熟悉 下面也只有很簡單的說明文 是真的很簡單的那種 真的有問題還是請大家自己找找 \ [第一篇](https://medium.com/%E8%AA%A4%E9%97%96%E6%95%B8%E6%93%9A%E5%8F%A2%E6%9E%97%E7%9A%84%E5%95%86%E7%AE%A1%E4%BA%BAzino/%E5%BF%AB%E9%80%9F%E4%B8%8A%E6%89%8Bpython%E9%96%8B%E7%99%BC%E7%92%B0%E5%A2%83spyder-%E9%87%8D%E9%BB%9E%E5%8A%9F%E8%83%BD%E8%A7%A3%E6%9E%90-%E5%90%AB%E6%95%99%E5%AD%B8%E5%BD%B1%E7%89%87-%E5%85%A5%E9%96%80%E7%B3%BB%E5%88%97-b9b0e9630a69) [第二篇](https://www.pressplay.cc/project/vippPage/51Python%E8%99%95%E7%90%86%E8%B3%87%E6%96%99%E5%B0%88%E5%B1%AC~/542246CF7419EC458723F613BE316184)** ::: # 開始 python 人生 ## 下載檔案 1. 確認你要下載的 modual 名稱 (pandas, matplotlib etc.) 2. google `conda modual名稱` * 以 [matplotlib](https://anaconda.org/conda-forge/matplotlib) 為例 * 複製第一行即可 3. 開啟你的 命令提示字元 * `window + R` 後輸入 `cmd` 4. 貼上指令 5. 會出現確認的頁面 直接 enter 即可 ![](https://i.imgur.com/V8W15lD.png) # 好文推薦 [你的第一次接觸 python](https://www.1989wolfe.com/2019/07/miniCONDAwithPython.html) [conda vs pip](https://medium.com/ai%E5%8F%8D%E6%96%97%E5%9F%8E/anaconda-miniconda-conda-pip%E7%9A%84%E7%9B%B8%E4%BA%92%E9%97%9C%E4%BF%82-%E8%BD%89%E8%BC%89-a0536f3a257)

    Import from clipboard

    Paste your markdown or webpage here...

    Advanced permission required

    Your current role can only read. Ask the system administrator to acquire write and comment permission.

    This team is disabled

    Sorry, this team is disabled. You can't edit this note.

    This note is locked

    Sorry, only owner can edit this note.

    Reach the limit

    Sorry, you've reached the max length this note can be.
    Please reduce the content or divide it to more notes, thank you!

    Import from Gist

    Import from Snippet

    or

    Export to Snippet

    Are you sure?

    Do you really want to delete this note?
    All users will lose their connection.

    Create a note from template

    Create a note from template

    Oops...
    This template has been removed or transferred.
    Upgrade
    All
    • All
    • Team
    No template.

    Create a template

    Upgrade

    Delete template

    Do you really want to delete this template?
    Turn this template into a regular note and keep its content, versions, and comments.

    This page need refresh

    You have an incompatible client version.
    Refresh to update.
    New version available!
    See releases notes here
    Refresh to enjoy new features.
    Your user state has changed.
    Refresh to load new user state.

    Sign in

    Forgot password

    or

    By clicking below, you agree to our terms of service.

    Sign in via Facebook Sign in via Twitter Sign in via GitHub Sign in via Dropbox Sign in with Wallet
    Wallet ( )
    Connect another wallet

    New to HackMD? Sign up

    Help

    • English
    • 中文
    • Français
    • Deutsch
    • 日本語
    • Español
    • Català
    • Ελληνικά
    • Português
    • italiano
    • Türkçe
    • Русский
    • Nederlands
    • hrvatski jezik
    • język polski
    • Українська
    • हिन्दी
    • svenska
    • Esperanto
    • dansk

    Documents

    Help & Tutorial

    How to use Book mode

    Slide Example

    API Docs

    Edit in VSCode

    Install browser extension

    Contacts

    Feedback

    Discord

    Send us email

    Resources

    Releases

    Pricing

    Blog

    Policy

    Terms

    Privacy

    Cheatsheet

    Syntax Example Reference
    # Header Header 基本排版
    - Unordered List
    • Unordered List
    1. Ordered List
    1. Ordered List
    - [ ] Todo List
    • Todo List
    > Blockquote
    Blockquote
    **Bold font** Bold font
    *Italics font* Italics font
    ~~Strikethrough~~ Strikethrough
    19^th^ 19th
    H~2~O H2O
    ++Inserted text++ Inserted text
    ==Marked text== Marked text
    [link text](https:// "title") Link
    ![image alt](https:// "title") Image
    `Code` Code 在筆記中貼入程式碼
    ```javascript
    var i = 0;
    ```
    var i = 0;
    :smile: :smile: Emoji list
    {%youtube youtube_id %} Externals
    $L^aT_eX$ LaTeX
    :::info
    This is a alert area.
    :::

    This is a alert area.

    Versions and GitHub Sync
    Get Full History Access

    • Edit version name
    • Delete

    revision author avatar     named on  

    More Less

    Note content is identical to the latest version.
    Compare
      Choose a version
      No search result
      Version not found
    Sign in to link this note to GitHub
    Learn more
    This note is not linked with GitHub
     

    Feedback

    Submission failed, please try again

    Thanks for your support.

    On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?

    Please give us some advice and help us improve HackMD.

     

    Thanks for your feedback

    Remove version name

    Do you want to remove this version name and description?

    Transfer ownership

    Transfer to
      Warning: is a public team. If you transfer note to this team, everyone on the web can find and read this note.

        Link with GitHub

        Please authorize HackMD on GitHub
        • Please sign in to GitHub and install the HackMD app on your GitHub repo.
        • HackMD links with GitHub through a GitHub App. You can choose which repo to install our App.
        Learn more  Sign in to GitHub

        Push the note to GitHub Push to GitHub Pull a file from GitHub

          Authorize again
         

        Choose which file to push to

        Select repo
        Refresh Authorize more repos
        Select branch
        Select file
        Select branch
        Choose version(s) to push
        • Save a new version and push
        • Choose from existing versions
        Include title and tags
        Available push count

        Pull from GitHub

         
        File from GitHub
        File from HackMD

        GitHub Link Settings

        File linked

        Linked by
        File path
        Last synced branch
        Available push count

        Danger Zone

        Unlink
        You will no longer receive notification when GitHub file changes after unlink.

        Syncing

        Push failed

        Push successfully