江承勳
    • 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 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

    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
    • Any changes
      Be notified of any changes
    • Mention me
      Be notified of mention me
    • Unsubscribe
    # AI智慧工坊筆記(一、環境建置) --- ## 使用軟體 1. Notepad++ [https://notepad-plus-plus.org/] 2. Python 3.7.5 for window x64[https://www.python.org/downloads/] 3. Git for Windows[https://gitforwindows.org/] ## 教材 [雲端學習教材](https://https://drive.google.com/file/d/11Z3mM2TFhbrk2n7DExt7c2In7ZyM-6L6/view?usp=sharing) [爬蟲範例](https://github.com/rkuo2000/scraper) [CV2範例](https://) # 預先具備知識 1. Python3 *邏輯語法 *函式庫安裝 3. Window for Linux(Git)環境建置 --- ### Linux 作業系統常用命令(Git Bash) $ls (列出目錄檔案) $cd ~ (換目錄) $mkdir new (產生新目錄) $rm file_name (移除檔案) $rm –rf directory_name (移除目錄) $df . (檢示SD卡用量) $free (檢查記憶體用量) $ps –a (列出正在執行的程序) $kill -9 567 (移除程序 id=567) $cat /etc/hostname (列出顯示檔案內容) $cat /etc/os-release (顯示OS 版本) $vi file_name (編輯檔案) $nano file_name (編輯檔案) $clear (清除螢幕顯示) $history (列出操作記錄) --- # Python 程式範例:json閱讀 Scraper/ read_json.py #### 說明: 使用GitClone指定下載資料夾,並且印出檔案中的內容。 1. 啟動Git Bash 2. 於Git Bash視窗中,下載github範例 : `$git clone https://github.com/rkuo2000/scraper` ![圖例](https://i.imgur.com/THumeSu.png) ![](https://i.imgur.com/gM1HKpz.png) ``` #code import json with open('ex.json' , 'r') as reader: jf = json.loads(reader.read()) print(jf['data']['hi_info']['login_ip']) print(jf['data']['hi_info']['hello_info']['license']['id']) ``` --- # Python程式範例:scrape_applenews Scraper/scrape_applenews.py #### 說明: 蘋果日報首頁標題爬蟲 > $pip install requests > $pip install BeautifulSoup4 > $pip install html5lib > > $python scrape_applenews.py ``` from bs4 import BeautifulSoup import requests #取得資料頁面 url = 'http://www.appledaily.com.tw/realtimenews/section/new/' res = requests.get(url) soup = BeautifulSoup(res.text, "html5lib") #時間、標題、分類 建立各自list #選擇.rtddt作為定位 抓取列表下元素 並且以text的方法加入lsit time=[] for item in soup.select('.rtddt time'): time.append(item.text) title=[] for item in soup.select('.rtddt h1'): title.append(item.text) category=[] for item in soup.select('.rtddt h2'): category.append(item.text) news = { 'time': time, 'title': title, 'category':category } for i in range(0, len(time)): print("%2d."%(i),news['time'][i], news['title'][i], news['category'][i]) ``` ![](https://i.imgur.com/ujtIO9C.png) > 20:02 黃馨頤:從市場開始的新型冠狀病毒 論壇 > 20:02 內政部長徐國勇至警局圍爐 視訊感謝警員家... 社會 20:00 【獨家踢爆】網購蘿蔔糕不能說的秘密 昆... 社會 19:58 警驅離428反核四靜坐害13傷 判國賠4... 社會 19:53 【防疫動員7】防口罩瘋搶漲! 政府釋出上... 生活 19:53 韓國瑜憂武漢肺炎影響觀光 「愛之鯨」吸3... 政治 19:47 【防疫動員2】首例染病女台商走路還喘 新... 生活 19:45 【防疫動員3】交部發武漢旅遊禁令! 華航... 生活 19:40 小丑女祝台灣恭喜發財 《猛禽小隊》女性視... 娛樂 19:38 【鴻海表演】張菲8度接主持500萬入袋 ... 娛樂 19:36 眼皮直跳好運兆 新北強運男連續刮中10萬... 生活 19:35 遠航籌款「有條件」 張綱維彎腰求「政府復... 生活 19:34 苦苓控韓國瑜「負債400億元」拒道歉 高... 政治 19:34 【名采】李昂專欄:吃星星的趣味 論壇 19:33 民生社區大店面多賠售 小店轉手勝率最高 地產 --- # Python程式範例:維基百科機器人 scrape_wikipedia.py #### 說明: 運用維基百科查詢相關資料 $python scrape_wikipedia.py en psychology `Psychology is the science of behavior and mind` $python scrape_Wikipedia.py zh-tw 蔡英文 `蔡英文(1956年8月31日-),中華民國政治人物、民主進步黨籍、法律學者、律師 ,為中華民國第14任總統` ---

    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