tingwei hsu
    • 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 No publishing access yet

      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.

      Your account was recently created. Publishing will be available soon, allowing you to share notes on your public page and in search results.

      Your team account was recently created. Publishing will be available soon, allowing you to share notes on your public page and in search results.

      Explore these features while you wait
      Complete general settings
      Bookmark and like published notes
      Write a few more notes
      Complete general settings
      Write a few more notes
      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 New
    • Engagement control
    • Make a copy
    • 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 Note Insights Versions and GitHub Sync Sharing URL Create Help
Create Create new note Create a note from template
Menu
Options
Engagement control Make a copy 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 No publishing access yet

    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.

    Your account was recently created. Publishing will be available soon, allowing you to share notes on your public page and in search results.

    Your team account was recently created. Publishing will be available soon, allowing you to share notes on your public page and in search results.

    Explore these features while you wait
    Complete general settings
    Bookmark and like published notes
    Write a few more notes
    Complete general settings
    Write a few more notes
    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
    • Any changes
      Be notified of any changes
    • Mention me
      Be notified of mention me
    • Unsubscribe
    # Mac OS Python 安裝流程 教程分為兩種,一種是Python 3,另外一種是Python 2,但都是使用Anaconda,由於Python(x,y)並不支援Mac OS,因此僅能提供兩種給各位自行嘗試。 ## Python 3 安裝步驟 進入Anaconda官網([](https://)https://www.anaconda.com/products/individual)後 拉到最下面有下載處。 ![](https://i.imgur.com/MOX9Fzf.png) 選擇64-Bit Graphical Installer 下載。 下載後找到Anaconda3.pkg點開安裝 ![](https://i.imgur.com/kEnp6jD.png) ![](https://i.imgur.com/sSclB3F.png) ![](https://i.imgur.com/YrPYc1b.png) ![](https://i.imgur.com/qYCeJTX.png) ![](https://i.imgur.com/uMbdLis.png) 安裝包安裝完後便可丟到垃圾桶。 ![](https://i.imgur.com/MOJBIb7.png) 到這基礎安裝結束。 在啟動台找到Anaconda-Navigator開啟,第一次會loading比較久。 ![](https://i.imgur.com/zKL5040.png) 開啟後會跳出下圖視窗,取消打勾選擇don't show again就可以了。 ![](https://i.imgur.com/ZjhGAUH.png) 這裡可以看到Anaconda的介面,是將許多工具整合在裡面,我們要使用的是Spyder(Python)下面的4.1.3是版本,通常更新到最新就可以了,接著點選Launch。 ![](https://i.imgur.com/MoVhDqz.png) ![](https://i.imgur.com/EtQQagV.png) 讀取完成後會跳出下面介面,初次開啟會先要求授權存取資料夾,會有一系列的要求權限,全部點選 "好" 就可以了。 ![](https://i.imgur.com/OuqJEG4.png) 點選完後會詢問是否安裝kite,一款輔助編程的軟件,有興趣的可以研究一下如何使用,但這裡我們統一先不安裝,所以點選"Dismiss"。 ![](https://i.imgur.com/wtdxRvk.png) 接著會詢問是否需要安裝 "git" 套件,這裡建議是都安裝,日後會比較方便,點選安裝。 同樣會有一系列要求,詢問是否安裝字體等,都是建議點選下載及安裝。 ![](https://i.imgur.com/vTxjkIZ.png) ![](https://i.imgur.com/pX4dXe6.png) ![](https://i.imgur.com/9z2sPmf.png) 安裝完畢後回到我們的介面,首先先測試一下我們要使用的基本模組是否有被正確加入環境中。 輸入 ```python= import numpy as np #引入numpy 套件 ``` 輸入完畢後按下快捷鍵fn+F5或是按下上面的綠色箭頭"執行" ###### 註: 這部份由於macOS的設定問題,鍵盤上的功能鍵的功能會優先於其他軟體的功能,可以去設定做設置,使得F5可以直接執行程式。 ![](https://i.imgur.com/2UhxHOJ.png) 執行後會跳出這個視窗,詢問執行的一些細節,大家可以參照下圖的設定,將"Remove all variables before execution" 打勾,會比較方便之後在右上角的Variables explorer 檢查參數。 ![](https://i.imgur.com/SLryfKG.png) ## 測試模組 到這裡算是確認可以正常運作,接下來測試一下"numpy"和"matplotlib"兩個最常使用的模組。 大家可以先把這段代碼複製進去測試一下。 ```python= import numpy as np #引入 numpy import matplotlib.pyplot as plt #引入matplotlib def f(x): #定義一個sin function做為測試用 return np.sin(x) t = np.arange(0,10,0.1) #建立一個array 0~10 0.1為間隔 plt.plot(f(t)) #繪圖 ``` 複製後執行,第一次執行應該會在右下角執行結果跳出一段文字 ![](https://i.imgur.com/f1tSj2I.png) ![](https://i.imgur.com/OTQxXTw.png) 表示圖片生成的位置在右上角的Plot中,但我們通常會習慣將圖繪製在Consule中,所以可以點選右邊那欄的"Plots",並將右上角選單點開,將"Mute inline plotting"項取消。 ![](https://i.imgur.com/0lDK7hz.png) 再次執行,就可以看到圖被繪製在Consule中了。 ![](https://i.imgur.com/X6iowY8.png) 另外由於這門課會使用到Vpython 所以我們也需要確認我們的環境是有Vpython的 我們可以在右下角的Console 輸入 `import vpython` 然後按下Enter,如果沒有報錯就代表你的環境已經可以使用Vpython了。 ![](https://i.imgur.com/snhb2nz.png) ## Python 2 安裝步驟 因為Vpython大多還是用於Python 2的場景下(雖然3也可用),但網路上資源比較多。考量到有些人也許也會有需求,同樣放上教學給各位。 使用剛剛裝好的或是已經建置好的Anaconda。 ![](https://i.imgur.com/AgovYsb.png) 選擇environments,點選base 旁的綠色箭頭選擇Open Terminal ![](https://i.imgur.com/ixVym80.png) ![](https://i.imgur.com/T7XlQsm.png) 打開後會得到好用但又可怕的東西,也許你的會和我的長得不太一樣,不過都是能用的。 我們需要輸入這串指令 ``` conda create -n py27 python=2.7 ``` ![](https://i.imgur.com/MAexDp8.png) 中間會停下來被問要不要安裝一些東西 輸入"y" 就對了。 這個時候回來看,你就可以看到新安裝的Python 2.7了。 ![](https://i.imgur.com/LIhqmGW.png) 接著點選py27的箭頭,選擇Open Terminal ![](https://i.imgur.com/3wL7b7m.png) 輸入這串指令來安裝Vpython ``` conda install -c mwcraig vpython ``` 完成後,回到command line 的畫面。 ![](https://i.imgur.com/fZSnjzf.png) 輸入 `pythonw` ![](https://i.imgur.com/E8StUTs.png) 這時候就可以輸入程式碼,我們測試一下Vpython。 輸入 `from visual import *` ![](https://i.imgur.com/0Mc92o4.png) 沒有報錯,且右下角會跳出一個繪圖的地方,就代表安裝成功。 由於Python(x,y)不支援Mac OS,因此在安裝的地方需要自行調適版本,助教已經盡力找到一個適合可以使用的版本。但還是較推薦使用Python 3 來安裝。 有問題都歡迎來信,或是來509A,可以當面幫你疑難排解!

    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
    Sign in via Facebook Sign in via X(Twitter) Sign in via GitHub Sign in via Dropbox Sign in with Wallet
    Wallet ( )
    Connect another wallet

    New to HackMD? Sign up

    By signing in, you agree to our terms of service.

    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