<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>visual studio code &#8211; 龍冥 Blog</title>
	<atom:link href="https://dragongo.co/tag/visual-studio-code/feed/" rel="self" type="application/rss+xml" />
	<link>https://dragongo.co</link>
	<description>Code &#38; Read</description>
	<lastBuildDate>Thu, 15 Jan 2026 07:37:01 +0000</lastBuildDate>
	<language>zh-TW</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=7.1.5</generator>

<image>
	<url>https://dragongo.co/wp-content/uploads/2021/05/cropped-cropped-LOGO-2-e1655437907165-32x32.png</url>
	<title>visual studio code &#8211; 龍冥 Blog</title>
	<link>https://dragongo.co</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>Python 爬蟲維基百科教學</title>
		<link>https://dragongo.co/python-%e7%88%ac%e7%b6%ad%e5%9f%ba%e7%99%be%e7%a7%91%e6%95%99%e5%ad%b8/</link>
		
		<dc:creator><![CDATA[龍冥]]></dc:creator>
		<pubDate>Sat, 19 Jun 2021 02:35:50 +0000</pubDate>
				<category><![CDATA[Python]]></category>
		<category><![CDATA[程式教學]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[visual studio code]]></category>
		<category><![CDATA[程式自學]]></category>
		<category><![CDATA[網路爬蟲]]></category>
		<guid isPermaLink="false">https://dragongo.co/?p=1496</guid>

					<description><![CDATA[]]></description>
										<content:encoded><![CDATA[
<pre><code class="c">// PIC18F25K83 Configuration Bit Settings

// 'C' source line config statements

// CONFIG1L
#pragma config FEXTOSC = HS     // External Oscillator Selection (HS (crystal oscillator) above 8 MHz; PFM set to high power)
#pragma config RSTOSC = EXTOSC  // Reset Oscillator Selection (EXTOSC operating per FEXTOSC bits (device manufacturing default))

// CONFIG1H
#pragma config CLKOUTEN = OFF   // Clock out Enable bit (CLKOUT function is disabled)
#pragma config PR1WAY = ON      // PRLOCKED One-Way Set Enable bit (PRLOCK bit can be cleared and set only once)
#pragma config CSWEN = ON       // Clock Switch Enable bit (Writing to NOSC and NDIV is allowed)
#pragma config FCMEN = ON       // Fail-Safe Clock Monitor Enable bit (Fail-Safe Clock Monitor enabled)

// CONFIG2L
#pragma config MCLRE = EXTMCLR  // MCLR Enable bit (If LVP = 0, MCLR pin is MCLR; If LVP = 1, RE3 pin function is MCLR )
#pragma config PWRTS = PWRT_OFF // Power-up timer selection bits (PWRT is disabled)
#pragma config MVECEN = ON      // Multi-vector enable bit (Multi-vector enabled, Vector table used for interrupts)
#pragma config IVT1WAY = ON     // IVTLOCK bit One-way set enable bit (IVTLOCK bit can be cleared and set only once)
#pragma config LPBOREN = OFF    // Low Power BOR Enable bit (ULPBOR disabled)
#pragma config BOREN = SBORDIS  // Brown-out Reset Enable bits (Brown-out Reset enabled , SBOREN bit is ignored)

// CONFIG2H
#pragma config BORV = VBOR_2P45 // Brown-out Reset Voltage Selection bits (Brown-out Reset Voltage (VBOR) set to 2.45V)
#pragma config ZCD = OFF        // ZCD Disable bit (ZCD disabled. ZCD can be enabled by setting the ZCDSEN bit of ZCDCON)
#pragma config PPS1WAY = ON     // PPSLOCK bit One-Way Set Enable bit (PPSLOCK bit can be cleared and set only once; PPS registers remain locked after one clear/set cycle)
#pragma config STVREN = ON      // Stack Full/Underflow Reset Enable bit (Stack full/underflow will cause Reset)
#pragma config DEBUG = OFF      // Debugger Enable bit (Background debugger disabled)
#pragma config XINST = OFF      // Extended Instruction Set Enable bit (Extended Instruction Set and Indexed Addressing Mode disabled)

// CONFIG3L
#pragma config WDTCPS = WDTCPS_31// WDT Period selection bits (Divider ratio 1:65536; software control of WDTPS)
#pragma config WDTE = OFF       // WDT operating mode (WDT Disabled; SWDTEN is ignored)

// CONFIG3H
#pragma config WDTCWS = WDTCWS_7// WDT Window Select bits (window always open (100%); software control; keyed access not required)
#pragma config WDTCCS = SC      // WDT input clock selector (Software Control)

// CONFIG4L
#pragma config BBSIZE = BBSIZE_512// Boot Block Size selection bits (Boot Block size is 512 words)
#pragma config BBEN = OFF       // Boot Block enable bit (Boot block disabled)
#pragma config SAFEN = OFF      // Storage Area Flash enable bit (SAF disabled)
#pragma config WRTAPP = OFF     // Application Block write protection bit (Application Block not write protected)

// CONFIG4H
#pragma config WRTB = OFF       // Configuration Register Write Protection bit (Configuration registers (300000-30000Bh) not write-protected)
#pragma config WRTC = OFF       // Boot Block Write Protection bit (Boot Block (000000-0007FFh) not write-protected)
#pragma config WRTD = OFF       // Data EEPROM Write Protection bit (Data EEPROM not write-protected)
#pragma config WRTSAF = OFF     // SAF Write protection bit (SAF not Write Protected)
#pragma config LVP = ON         // Low Voltage Programming Enable bit (Low voltage programming enabled. MCLR/VPP pin function is MCLR. MCLRE configuration bit is ignored)
// CONFIG5L
#pragma config CP = OFF         // PFM and Data EEPROM Code Protection bit (PFM and Data EEPROM code protection disabled)

// CONFIG5H

// #pragma config statements should precede project file includes.
// Use project enums instead of #define for ON and OFF.

#include <xc.h>
</xc.h></code></pre>



<p class="wp-block-paragraph"></p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Python pip指令集教學</title>
		<link>https://dragongo.co/%e7%94%9a%e9%ba%bc%e6%98%afpython-pip%ef%bc%8c%e5%8f%af%e4%bb%a5%e5%90%83%e5%97%8e%ef%bc%9f/</link>
		
		<dc:creator><![CDATA[龍冥]]></dc:creator>
		<pubDate>Sat, 05 Jun 2021 09:55:44 +0000</pubDate>
				<category><![CDATA[Python]]></category>
		<category><![CDATA[pip]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[visual studio code]]></category>
		<category><![CDATA[程式自學]]></category>
		<guid isPermaLink="false">https://dragongo.co/?p=1309</guid>

					<description><![CDATA[在地下城尋找python pip，是否搞錯了什麼&#8230;]]></description>
										<content:encoded><![CDATA[
<blockquote class="wp-block-quote is-layout-flow wp-block-quote-is-layout-flow"><p>在地下城尋找python pip，是否搞錯了什麼？有沒有空？可以來拯救嗎？</p><cite>來自在地下城尋找邂逅，是否搞錯了什麼？</cite></blockquote>



<h2 class="wp-block-heading">什麼是pip，可以吃嗎？</h2>



<p class="wp-block-paragraph"><a href="https://zh.wikipedia.org/wiki/Pip_(%E8%BB%9F%E4%BB%B6%E5%8C%85%E7%AE%A1%E7%90%86%E7%B3%BB%E7%B5%B1)" target="_blank" rel="noreferrer noopener">pip</a>是屬於Python底下的一個安裝管理套件工具，其功能主要是在做安裝Python其他的軟體包和模組(例如：BeautifulSoup、request、math&#8230;&#8230;)，所以今天你需要使用這些外掛的軟體模組時，就需要使用到pip安裝或是更新。</p>



<h2 class="wp-block-heading">如何安裝pip？</h2>



<p class="wp-block-paragraph">目前Python3.4版本以上的或Python2.7.9版本以上的Python都自帶pip工具，所以基本上不需要安裝pip可以直接使用。</p>



<p class="wp-block-paragraph">若你執行pip發生：「<a href="https://dragongo.co/%e8%a7%a3%e6%b1%ba%ef%bc%9a%e7%84%a1%e6%b3%95%e8%be%a8%e8%ad%98-pip-%e8%a9%9e%e5%bd%99%e6%98%af%e5%90%a6%e7%82%ba-cmdlet%e3%80%81%e5%87%bd%e6%95%b8%e3%80%81%e6%8c%87%e4%bb%a4%e6%aa%94%e6%88%96/" target="_blank" rel="noreferrer noopener">無法辨識 ‘pip’ 詞彙是否為 Cmdlet、函數、指令檔或可執行程式的名稱。請檢查名稱拼字是否正確，如果包含路徑的話，請確認路徑是否正確，然後再試一次。</a>」錯誤的話，請點級超連結。</p>



<h5 class="wp-block-heading">使用命令題是字元(cmd)指令查詢目前的Python版本：</h5>



<pre class="wp-block-code"><code>python --version</code></pre>



<figure class="wp-block-image size-large is-resized is-style-default"><img fetchpriority="high" decoding="async" src="https://dragongo.co/wp-content/uploads/2021/06/image-11.png" alt="image 11" class="wp-image-1312" width="842" height="214" title="Python pip指令集教學 1" srcset="https://dragongo.co/wp-content/uploads/2021/06/image-11.png 562w, https://dragongo.co/wp-content/uploads/2021/06/image-11-300x76.png 300w" sizes="(max-width: 842px) 100vw, 842px" /></figure>



<div class="wp-block-columns is-layout-flex wp-container-core-columns-is-layout-8f761849 wp-block-columns-is-layout-flex">
<div class="wp-block-column is-layout-flow wp-block-column-is-layout-flow" style="flex-basis:100%">
<div class="wp-block-group"><div class="wp-block-group__inner-container is-layout-flow wp-block-group-is-layout-flow">
<h5 class="wp-block-heading">1、透過<a href="https://pip.pypa.io/en/stable/installing/" target="_blank" data-type="URL" data-id="https://pip.pypa.io/en/stable/installing/" rel="noreferrer noopener">pip官網</a>下載安裝pip</h5>



<pre id="codecell6" class="wp-block-code"><code>curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py</code></pre>



<h5 class="wp-block-heading">2、啟動下載好的pip安裝檔，即可安裝完成。</h5>



<pre id="codecell4" class="wp-block-code"><code>py get-pip.py</code></pre>



<h5 class="wp-block-heading">3、透過檢查pip版本，確認安裝完成</h5>



<pre id="codecell4" class="wp-block-code"><code>py -m pip --version</code></pre>



<hr class="wp-block-separator"/>



<h3 class="wp-block-heading">pip指令包</h3>



<pre class="wp-block-code"><code>Usage:
  pip &lt;command> &#91;options]

Commands:
  install                     Install packages.
  download                    Download packages.
  uninstall                   Uninstall packages.
  freeze                      Output installed packages in requirements format.
  list                        List installed packages.
  show                        Show information about installed packages.
  check                       Verify installed packages have compatible dependencies.
  config                      Manage local and global configuration.
  search                      Search PyPI for packages.
  cache                       Inspect and manage pip's wheel cache.
  wheel                       Build wheels from your requirements.
  hash                        Compute hashes of package archives.
  completion                  A helper command used for command completion.
  debug                       Show information useful for debugging.
  help                        Show help for commands.

General Options:
  -h, --help                  Show help.
  --isolated                  Run pip in an isolated mode, ignoring environment variables and user configuration.
  -v, --verbose               Give more output. Option is additive, and can be used up to 3 times.
  -V, --version               Show version and exit.
  -q, --quiet                 Give less output. Option is additive, and can be used up to 3 times (corresponding to
                              WARNING, ERROR, and CRITICAL logging levels).
  --log &lt;path>                Path to a verbose appending log.
  --no-input                  Disable prompting for input.
  --proxy &lt;proxy>             Specify a proxy in the form &#91;user:passwd@]proxy.server:port.
  --retries &lt;retries>         Maximum number of retries each connection should attempt (default 5 times).
  --timeout &lt;sec>             Set the socket timeout (default 15 seconds).
  --exists-action &lt;action>    Default action when a path already exists: (s)witch, (i)gnore, (w)ipe, (b)ackup,
                              (a)bort.
  --trusted-host &lt;hostname>   Mark this host or host:port pair as trusted, even though it does not have valid or any
                              HTTPS.
  --cert &lt;path>               Path to alternate CA bundle.
  --client-cert &lt;path>        Path to SSL client certificate, a single file containing the private key and the
                              certificate in PEM format.
  --cache-dir &lt;dir>           Store the cache data in &lt;dir>.
  --no-cache-dir              Disable the cache.
  --disable-pip-version-check
                              Don't periodically check PyPI to determine whether a new version of pip is available for
                              download. Implied with --no-index.
  --no-color                  Suppress colored output
  --no-python-version-warning
                              Silence deprecation warnings for upcoming unsupported Pythons.
  --use-feature &lt;feature>     Enable new functionality, that may be backward incompatible.
  --use-deprecated &lt;feature>  Enable deprecated functionality, that will be removed in the future.</code></pre>
</div></div>
</div>
</div>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Python正規表示式(Regular expression)</title>
		<link>https://dragongo.co/python%e6%ad%a3%e8%a6%8f%e8%a1%a8%e7%a4%ba%e5%bc%8fregular-expression/</link>
		
		<dc:creator><![CDATA[龍冥]]></dc:creator>
		<pubDate>Fri, 21 May 2021 14:20:48 +0000</pubDate>
				<category><![CDATA[Python]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[requests]]></category>
		<category><![CDATA[visual studio code]]></category>
		<category><![CDATA[正規表示式]]></category>
		<category><![CDATA[自學程式]]></category>
		<guid isPermaLink="false">https://dragongo.co/?p=1226</guid>

					<description><![CDATA[Regular expression翻譯有幾種版&#8230;]]></description>
										<content:encoded><![CDATA[
<p class="wp-block-paragraph">Regular expression翻譯有幾種版本：正則表達式、正規表示式、正規表示法、規則運算式。<br>若是看到這幾種敘述，皆是指Regular expression。</p>



<h4 class="wp-block-heading">重要的第一步：匯入re模組</h4>



<p class="wp-block-paragraph">只要使用正規表示式，必須要在開頭處打匯入re模組指令：</p>



<pre><code class="python">import requests</code></pre>



<p class="wp-block-paragraph">若是沒有匯入，會得到錯誤：</p>



<pre><code class="python">NameError: name 're' is not defined</pre>



<p class="wp-block-paragraph">參考莫凡<a href="https://mofanpy.com/tutorials/python-basic/basic/regular-expression/" target="_blank" data-type="URL" data-id="https://mofanpy.com/tutorials/python-basic/basic/regular-expression/" rel="noreferrer noopener" class="rank-math-link">正規表示式教學</a>的範例碼，另外也可從「<a href="https://selflearningsuccess.com/python-regex/#%E6%9C%80%E9%87%8D%E8%A6%81%E7%9A%84%E7%AC%AC%E4%B8%80%E6%AD%A5_%E5%8C%AF%E5%85%A5re_%E6%A8%A1%E7%B5%84" target="_blank" data-type="URL" data-id="https://selflearningsuccess.com/python-regex/#%E6%9C%80%E9%87%8D%E8%A6%81%E7%9A%84%E7%AC%AC%E4%B8%80%E6%AD%A5_%E5%8C%AF%E5%85%A5re_%E6%A8%A1%E7%B5%84" rel="noreferrer noopener" class="rank-math-link">Python正規表示式：不一定要會，但會了超省力</a>」這篇文章找到使用教學。</p>



<pre><code class="python"># %%
pattern1 = "cat"
pattern2 = "dog"
string = "dog run!"
print(pattern1 in string)
print(pattern2 in string)

# %%
import re
# regular expression
pattern1 = "cat"
pattern2 = "dog"
string = "dog run!"
print(re.search(pattern1 , string))
print(re.search(pattern2 , string))
# %%
# multiple patterns ("run" or "ran")
ptn = r"r[au]n"       # start with "r" means raw string
print(re.search(ptn, "dog runs to cat"))    # <_sre.SRE_Match object; span=(4, 7), match='run'>

print(re.search(r"r[A-Z]n", "dog runs to cat"))     # None
print(re.search(r"r[a-z]n", "dog runs to cat"))     # <_sre.SRE_Match object; span=(4, 7), match='run'>
print(re.search(r"r[0-9]n", "dog r2ns to cat"))     # <_sre.SRE_Match object; span=(4, 7), match='r2n'>
print(re.search(r"r[0-9a-z]n", "dog runs to cat"))  # <_sre.SRE_Match object; span=(4, 7), match='run'>

# %%
# \d : decimal digit
print(re.search(r"r\dn", "run r4n"))                # <_sre.SRE_Match object; span=(4, 7), match='r4n'>
# \D : any non-decimal digit
print(re.search(r"r\Dn", "run r4n"))                # <_sre.SRE_Match object; span=(0, 3), match='run'>

# %%
# \s : any white space [\t\n\r\f\v]
print(re.search(r"r\sn", "r\nn r4n"))               # <_sre.SRE_Match object; span=(0, 3), match='r\nn'>
# \S : opposite to \s, any non-white space
print(re.search(r"r\Sn", "r\nn r4n"))               # <_sre.SRE_Match object; span=(4, 7), match='r4n'>

# %%
# \w : [a-zA-Z0-9_]
print(re.search(r"r\wn", "r\nn r4n"))               # <_sre.SRE_Match object; span=(4, 7), match='r4n'>
# \W : opposite to \w
print(re.search(r"r\Wn", "r\nn r4n"))               # <_sre.SRE_Match object; span=(0, 3), match='r\nn'>

#%%空白文字
# \b : empty string (only at the start or end of the word)
print(re.search(r"\bruns\b", "dog runs to cat"))    # <_sre.SRE_Match object; span=(4, 8), match='runs'>
# \B : empty string (but not at the start or end of a word)
print(re.search(r"\B runs \B", "dog   runs  to cat"))  # <_sre.SRE_Match object; span=(8, 14), match=' runs '>

# %%找尋反斜線(\)
# \\ : match \
print(re.search(r"runs\\", "runs\ to me"))          # <_sre.SRE_Match object; span=(0, 5), match='runs\\'>
# . : match anything (except \n)(可以找尋任何特殊字元)
print(re.search(r"r.n", "r[ns to me"))              # <_sre.SRE_Match object; span=(0, 3), match='r[n'>

# %%句首句尾
# ^ : match line beginning(只能在句首)
print(re.search(r"^dog", "dog runs to cat"))        # <_sre.SRE_Match object; span=(0, 3), match='dog'>
# $ : match line ending(只能在句尾)
print(re.search(r"cat$", "dog runs to cat"))        # <_sre.SRE_Match object; span=(12, 15), match='cat'>

# %%是否
# ? : may or may not occur(括號內的文字無論是否存在，皆會找到)
print(re.search(r"Mon(day)?", "Monday"))            # <_sre.SRE_Match object; span=(0, 6), match='Monday'>
print(re.search(r"Mon(day)?", "Mon"))               # <_sre.SRE_Match object; span=(0, 3), match='Mon'>

# %%
# multi-line判斷多行
string = """
dog runs to cat.
I run to dog.
"""
print(re.search(r"^I", string))                     # None
print(re.search(r"^I", string, flags=re.M))         # <_sre.SRE_Match object; span=(18, 19), match='I'>

# %%
# * : occur 0 or more times出現過0或多次
print(re.search(r"ab*", "a"))                       # <_sre.SRE_Match object; span=(0, 1), match='a'>
print(re.search(r"ab*", "abbbbb"))                  # <_sre.SRE_Match object; span=(0, 6), match='abbbbb'>

# %% 
# + : occur 1 or more times
print(re.search(r"ab+", "a"))                       # None
print(re.search(r"ab+", "abbbb"))                  # <_sre.SRE_Match object; span=(0, 6), match='abbbbb'>

# %%
# {n, m} : occur n to m times(介於重複n到m次之間)
print(re.search(r"ab{2,10}", "a"))                  # None
print(re.search(r"ab{2,10}", "abbbbb"))             # <_sre.SRE_Match object; span=(0, 6), match='abbbbb'>

# %%
# group(搜尋結果分組)
match = re.search(r"(\d+), Date: (.+)", "ID: 021523, Date: Feb/12/2017")
print(match.group())                                # 021523, Date: Feb/12/2017
print(match.group(1))                               # 021523
print(match.group(2))                               # Date: Feb/12/2017

match = re.search(r"(?P<id>\d+), Date: (?P<date>.+)", "ID: 021523, Date: Feb/12/2017")
print(match.group('id'))                            # 021523
print(match.group('date'))                          # Date: Feb/12/2017

# %%
# findall(找尋全部)
print(re.findall(r"r[ua]n", "run ran ren"))         # ['run', 'ran']

# %%
# | : or(或者條件的指令)
print(re.findall(r"(run|ran)", "run ran ren"))      # ['run', 'ran']

# %%
# re.sub() replace(替換指令)
print(re.sub(r"r[au]ns", "catches", "dog runs to cat"))     # dog catches to cat


# %%
# re.split()(分隔指令)
print(re.split(r"[,;\.]", "a;b,c.d;e"))             # ['a', 'b', 'c', 'd', 'e']

# %%
# compile
compiled_re = re.compile(r"r[ua]n")
print(compiled_re.search("dog ran to cat"))     # <_sre.SRE_Match object; span=(4, 7), match='ran'>
</pre>



<div class="wp-block-image is-style-default"><figure class="aligncenter size-large is-resized"><img decoding="async" src="https://dragongo.co/wp-content/uploads/2021/05/image-26.png" alt="image 26" class="wp-image-1230" width="510" height="588" title="Python正規表示式(Regular expression) 2" srcset="https://dragongo.co/wp-content/uploads/2021/05/image-26.png 526w, https://dragongo.co/wp-content/uploads/2021/05/image-26-260x300.png 260w" sizes="(max-width: 510px) 100vw, 510px" /></figure></div>



<div class="wp-block-image is-style-default"><figure class="aligncenter size-large"><img decoding="async" width="688" height="795" src="https://dragongo.co/wp-content/uploads/2021/05/image-27.png" alt="image 27" class="wp-image-1231" title="Python正規表示式(Regular expression) 3" srcset="https://dragongo.co/wp-content/uploads/2021/05/image-27.png 688w, https://dragongo.co/wp-content/uploads/2021/05/image-27-260x300.png 260w" sizes="(max-width: 688px) 100vw, 688px" /></figure></div>


]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Python pip錯誤：無法辨識 &#8216;pip&#8217; 詞彙是否為 Cmdlet、函數、指令檔或可執行程式的名稱。請檢查名稱拼字是否正確，如果包含路徑的話，請確認路徑是否正確，然後再試一次。</title>
		<link>https://dragongo.co/%e8%a7%a3%e6%b1%ba%ef%bc%9a%e7%84%a1%e6%b3%95%e8%be%a8%e8%ad%98-pip-%e8%a9%9e%e5%bd%99%e6%98%af%e5%90%a6%e7%82%ba-cmdlet%e3%80%81%e5%87%bd%e6%95%b8%e3%80%81%e6%8c%87%e4%bb%a4%e6%aa%94%e6%88%96/</link>
					<comments>https://dragongo.co/%e8%a7%a3%e6%b1%ba%ef%bc%9a%e7%84%a1%e6%b3%95%e8%be%a8%e8%ad%98-pip-%e8%a9%9e%e5%bd%99%e6%98%af%e5%90%a6%e7%82%ba-cmdlet%e3%80%81%e5%87%bd%e6%95%b8%e3%80%81%e6%8c%87%e4%bb%a4%e6%aa%94%e6%88%96/#comments</comments>
		
		<dc:creator><![CDATA[龍冥]]></dc:creator>
		<pubDate>Fri, 21 May 2021 03:38:18 +0000</pubDate>
				<category><![CDATA[Python]]></category>
		<category><![CDATA[程式教學]]></category>
		<category><![CDATA[pip]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[visual studio code]]></category>
		<category><![CDATA[程式自學]]></category>
		<guid isPermaLink="false">https://dragongo.co/?p=1199</guid>

					<description><![CDATA[第一步：開啟檢視進階系統設定
第二步：選擇環進變數
第三步：從系統變數中選擇PATH變數
第四步：按下新增
第五步：在新的一欄複製上C:\Users\"你的使用者名稱"\AppData\Local\Programs\Python\Python38-32\Scripts
]]></description>
										<content:encoded><![CDATA[
<blockquote class="wp-block-quote is-layout-flow wp-block-quote-is-layout-flow">
<p class="wp-block-paragraph">重要更新：這篇文章所提的解答方案僅限於直接安裝python在電腦上，而沒有搭建anaconda之類虛擬環境的python電腦，若可以的話，建議研究如何安裝Anaconda的Python虛擬環境後在執行VScode，應該就不會有這個問題~</p>
</blockquote>



<p class="wp-block-paragraph">若你在執行powershell、命令提示自元或是visual studio code的終端機使用pip安裝指令遇到下述文字的話，此篇將帶你解決這個問題。</p>



<blockquote class="wp-block-quote is-style-default is-layout-flow wp-block-quote-is-layout-flow">
<p class="wp-block-paragraph">無法辨識 &#8216;pip&#8217; 詞彙是否為 Cmdlet、函數、指令檔或可執行程式的名稱。請檢查名稱拼字是否正確，如果包含路徑的話，請確認路徑是否正確，然後再試一次。</p>
</blockquote>



<figure class="wp-block-image size-large is-style-default"><img loading="lazy" decoding="async" width="1024" height="216" src="https://dragongo.co/wp-content/uploads/2021/05/image-13-1024x216.png" alt="image 13" class="wp-image-1202" title="Python pip錯誤：無法辨識 &#039;pip&#039; 詞彙是否為 Cmdlet、函數、指令檔或可執行程式的名稱。請檢查名稱拼字是否正確，如果包含路徑的話，請確認路徑是否正確，然後再試一次。 4" srcset="https://dragongo.co/wp-content/uploads/2021/05/image-13-1024x216.png 1024w, https://dragongo.co/wp-content/uploads/2021/05/image-13-300x63.png 300w, https://dragongo.co/wp-content/uploads/2021/05/image-13-768x162.png 768w, https://dragongo.co/wp-content/uploads/2021/05/image-13-1536x323.png 1536w, https://dragongo.co/wp-content/uploads/2021/05/image-13-1140x240.png 1140w, https://dragongo.co/wp-content/uploads/2021/05/image-13.png 1919w" sizes="(max-width: 1024px) 100vw, 1024px" /></figure>



<h4 class="wp-block-heading">第一步：開啟檢視進階系統設定</h4>



<figure class="wp-block-image is-style-default"><img loading="lazy" decoding="async" width="1024" height="765" src="https://dragongo.co/wp-content/uploads/2021/05/image-14-1024x765.png" alt="image 14" class="wp-image-1203" title="Python pip錯誤：無法辨識 &#039;pip&#039; 詞彙是否為 Cmdlet、函數、指令檔或可執行程式的名稱。請檢查名稱拼字是否正確，如果包含路徑的話，請確認路徑是否正確，然後再試一次。 5" srcset="https://dragongo.co/wp-content/uploads/2021/05/image-14-1024x765.png 1024w, https://dragongo.co/wp-content/uploads/2021/05/image-14-300x224.png 300w, https://dragongo.co/wp-content/uploads/2021/05/image-14-768x574.png 768w, https://dragongo.co/wp-content/uploads/2021/05/image-14.png 1068w" sizes="(max-width: 1024px) 100vw, 1024px" /></figure>



<h4 class="wp-block-heading">第二步：選擇環進變數</h4>



<figure class="wp-block-image size-large is-style-default"><img loading="lazy" decoding="async" width="612" height="670" src="https://dragongo.co/wp-content/uploads/2021/05/image-15.png" alt="image 15" class="wp-image-1204" title="Python pip錯誤：無法辨識 &#039;pip&#039; 詞彙是否為 Cmdlet、函數、指令檔或可執行程式的名稱。請檢查名稱拼字是否正確，如果包含路徑的話，請確認路徑是否正確，然後再試一次。 6" srcset="https://dragongo.co/wp-content/uploads/2021/05/image-15.png 612w, https://dragongo.co/wp-content/uploads/2021/05/image-15-274x300.png 274w" sizes="(max-width: 612px) 100vw, 612px" /></figure>



<h4 class="wp-block-heading">第三步：從系統變數中選擇PATH變數，並按下編輯，若不小心按到刪除或新增，先將整個視窗取消，重新從第一部操作，避免影響windows系統。</h4>



<figure class="wp-block-image size-large is-style-default"><img loading="lazy" decoding="async" width="792" height="740" src="https://dragongo.co/wp-content/uploads/2021/05/image-17.png" alt="image 17" class="wp-image-1206" title="Python pip錯誤：無法辨識 &#039;pip&#039; 詞彙是否為 Cmdlet、函數、指令檔或可執行程式的名稱。請檢查名稱拼字是否正確，如果包含路徑的話，請確認路徑是否正確，然後再試一次。 7" srcset="https://dragongo.co/wp-content/uploads/2021/05/image-17.png 792w, https://dragongo.co/wp-content/uploads/2021/05/image-17-300x280.png 300w, https://dragongo.co/wp-content/uploads/2021/05/image-17-768x718.png 768w" sizes="(max-width: 792px) 100vw, 792px" /></figure>



<h4 class="wp-block-heading">第四步：按下新增</h4>



<figure class="wp-block-image size-large is-style-default"><img loading="lazy" decoding="async" width="711" height="632" src="https://dragongo.co/wp-content/uploads/2021/05/image-18.png" alt="image 18" class="wp-image-1207" title="Python pip錯誤：無法辨識 &#039;pip&#039; 詞彙是否為 Cmdlet、函數、指令檔或可執行程式的名稱。請檢查名稱拼字是否正確，如果包含路徑的話，請確認路徑是否正確，然後再試一次。 8" srcset="https://dragongo.co/wp-content/uploads/2021/05/image-18.png 711w, https://dragongo.co/wp-content/uploads/2021/05/image-18-300x267.png 300w" sizes="(max-width: 711px) 100vw, 711px" /></figure>



<h4 class="wp-block-heading">第五步：在新的一欄複製上</h4>



<blockquote class="wp-block-quote is-layout-flow wp-block-quote-is-layout-flow">
<p class="wp-block-paragraph">C:\Users\&#8221;你的使用者名稱&#8221;\AppData\Local\Programs\Python\Python38-32\Scripts</p>
</blockquote>



<figure class="wp-block-image size-large is-style-default"><img loading="lazy" decoding="async" width="677" height="632" src="https://dragongo.co/wp-content/uploads/2021/05/image-19.png" alt="image 19" class="wp-image-1208" title="Python pip錯誤：無法辨識 &#039;pip&#039; 詞彙是否為 Cmdlet、函數、指令檔或可執行程式的名稱。請檢查名稱拼字是否正確，如果包含路徑的話，請確認路徑是否正確，然後再試一次。 9" srcset="https://dragongo.co/wp-content/uploads/2021/05/image-19.png 677w, https://dragongo.co/wp-content/uploads/2021/05/image-19-300x280.png 300w" sizes="(max-width: 677px) 100vw, 677px" /></figure>



<div class="wp-block-group"><div class="wp-block-group__inner-container is-layout-flow wp-block-group-is-layout-flow">
<p class="wp-block-paragraph">可以將C:\Users\&#8221;你的使用者名稱&#8221;\AppData\Local\Programs\Python\Python38-32\Scripts複製到檔案總管的目錄，確認是否有pip.exe</p>



<figure class="wp-block-image size-large is-style-default"><img loading="lazy" decoding="async" width="1024" height="576" src="https://dragongo.co/wp-content/uploads/2021/05/螢幕擷取畫面-2021-05-21-111620-1024x576.png" alt="螢幕擷取畫面 2021 05 21 111620" class="wp-image-1210" title="Python pip錯誤：無法辨識 &#039;pip&#039; 詞彙是否為 Cmdlet、函數、指令檔或可執行程式的名稱。請檢查名稱拼字是否正確，如果包含路徑的話，請確認路徑是否正確，然後再試一次。 10" srcset="https://dragongo.co/wp-content/uploads/2021/05/螢幕擷取畫面-2021-05-21-111620-1024x576.png 1024w, https://dragongo.co/wp-content/uploads/2021/05/螢幕擷取畫面-2021-05-21-111620-300x169.png 300w, https://dragongo.co/wp-content/uploads/2021/05/螢幕擷取畫面-2021-05-21-111620-768x432.png 768w, https://dragongo.co/wp-content/uploads/2021/05/螢幕擷取畫面-2021-05-21-111620-1536x864.png 1536w, https://dragongo.co/wp-content/uploads/2021/05/螢幕擷取畫面-2021-05-21-111620-1140x641.png 1140w, https://dragongo.co/wp-content/uploads/2021/05/螢幕擷取畫面-2021-05-21-111620.png 1920w" sizes="(max-width: 1024px) 100vw, 1024px" /></figure>
</div></div>



<h4 class="wp-block-heading">第六步：按下確認</h4>


<div class="wp-block-image is-style-default">
<figure class="aligncenter is-resized"><img loading="lazy" decoding="async" src="https://dragongo.co/wp-content/uploads/2021/05/image-21.png" alt="image 21" class="wp-image-1213" width="522" height="491" title="Python pip錯誤：無法辨識 &#039;pip&#039; 詞彙是否為 Cmdlet、函數、指令檔或可執行程式的名稱。請檢查名稱拼字是否正確，如果包含路徑的話，請確認路徑是否正確，然後再試一次。 11" srcset="https://dragongo.co/wp-content/uploads/2021/05/image-21.png 677w, https://dragongo.co/wp-content/uploads/2021/05/image-21-300x282.png 300w" sizes="(max-width: 522px) 100vw, 522px" /></figure>
</div>

<div class="wp-block-image is-style-default">
<figure class="aligncenter size-large is-resized"><img loading="lazy" decoding="async" src="https://dragongo.co/wp-content/uploads/2021/05/image-24.png" alt="image 24" class="wp-image-1216" width="527" height="493" title="Python pip錯誤：無法辨識 &#039;pip&#039; 詞彙是否為 Cmdlet、函數、指令檔或可執行程式的名稱。請檢查名稱拼字是否正確，如果包含路徑的話，請確認路徑是否正確，然後再試一次。 12" srcset="https://dragongo.co/wp-content/uploads/2021/05/image-24.png 792w, https://dragongo.co/wp-content/uploads/2021/05/image-24-300x280.png 300w, https://dragongo.co/wp-content/uploads/2021/05/image-24-768x718.png 768w" sizes="(max-width: 527px) 100vw, 527px" /></figure>
</div>

<div class="wp-block-image is-style-default">
<figure class="aligncenter size-large is-resized"><img loading="lazy" decoding="async" src="https://dragongo.co/wp-content/uploads/2021/05/image-25.png" alt="image 25" class="wp-image-1217" width="550" height="708" title="Python pip錯誤：無法辨識 &#039;pip&#039; 詞彙是否為 Cmdlet、函數、指令檔或可執行程式的名稱。請檢查名稱拼字是否正確，如果包含路徑的話，請確認路徑是否正確，然後再試一次。 13" srcset="https://dragongo.co/wp-content/uploads/2021/05/image-25.png 612w, https://dragongo.co/wp-content/uploads/2021/05/image-25-233x300.png 233w" sizes="(max-width: 550px) 100vw, 550px" /></figure>
</div>


<h4 class="wp-block-heading">第七步：重新開啟命令提示自元(cmd)、Visual Studio Code等軟體，重新輸入指令，即可解決此問題。</h4>
]]></content:encoded>
					
					<wfw:commentRss>https://dragongo.co/%e8%a7%a3%e6%b1%ba%ef%bc%9a%e7%84%a1%e6%b3%95%e8%be%a8%e8%ad%98-pip-%e8%a9%9e%e5%bd%99%e6%98%af%e5%90%a6%e7%82%ba-cmdlet%e3%80%81%e5%87%bd%e6%95%b8%e3%80%81%e6%8c%87%e4%bb%a4%e6%aa%94%e6%88%96/feed/</wfw:commentRss>
			<slash:comments>4</slash:comments>
		
		
			</item>
		<item>
		<title>安裝BeautifulSoup教學(環境：Visual Studio Code)</title>
		<link>https://dragongo.co/%e5%ae%89%e8%a3%9dbeatifulsoup%e6%95%99%e5%ad%b8%e7%92%b0%e5%a2%83%ef%bc%9avisula-studio-code/</link>
					<comments>https://dragongo.co/%e5%ae%89%e8%a3%9dbeatifulsoup%e6%95%99%e5%ad%b8%e7%92%b0%e5%a2%83%ef%bc%9avisula-studio-code/#comments</comments>
		
		<dc:creator><![CDATA[龍冥]]></dc:creator>
		<pubDate>Sat, 15 May 2021 01:00:00 +0000</pubDate>
				<category><![CDATA[Python]]></category>
		<category><![CDATA[beautifulsoup]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[visual studio code]]></category>
		<category><![CDATA[網頁爬蟲]]></category>
		<category><![CDATA[自學程式]]></category>
		<guid isPermaLink="false">https://dragongo.co/?p=980</guid>

					<description><![CDATA[教你如何在visual studio code下安裝beautifulsoup。]]></description>
										<content:encoded><![CDATA[
<div class="wp-block-group"><div class="wp-block-group__inner-container is-layout-flow wp-block-group-is-layout-flow">
<p class="wp-block-paragraph">在開始python網頁爬蟲之前，需要先安裝其分析模組和取樣模組。</p>



<ol class="wp-block-list"><li>開啟visual studio code的終端機介面。</li><li>使用<a aria-label="pip (opens in a new tab)" href="https://officeguide.cc/windows-install-python-pip-tutorial-2019/" target="_blank" rel="noreferrer noopener" class="rank-math-link">pip</a>指令安裝beautifulsoup4，其目的是用來分析html資料。<ul><li>pip install beautifulsoup4</li><li>C:\Users\User\AppData\Local\Programs\Python\Python39\Scripts</li><li>(若遇到「<a href="https://dragongo.co/%e8%a7%a3%e6%b1%ba%ef%bc%9a%e7%84%a1%e6%b3%95%e8%be%a8%e8%ad%98-pip-%e8%a9%9e%e5%bd%99%e6%98%af%e5%90%a6%e7%82%ba-cmdlet%e3%80%81%e5%87%bd%e6%95%b8%e3%80%81%e6%8c%87%e4%bb%a4%e6%aa%94%e6%88%96/" target="_blank" rel="noreferrer noopener">無法辨識 ‘pip’ 詞彙是否為 Cmdlet、函數、指令檔或可執行程式的名稱。請檢查名稱拼字是否正確，如果包含路徑的話，請確認路徑是否正確，然後再試一次。</a>」錯誤的話，請點及超連結)</li></ul></li><li>使用pip指令安裝python的requests套件，其目的是將html資料抓回來顯示。<ul><li>pip install requests</li></ul></li><li>嘗試執行以下程式碼，其程式目的是將莫凡提供的<a aria-label=" (opens in a new tab)" href="https://mofanpy.com/static/scraping/basic-structure.html" target="_blank" rel="noreferrer noopener" class="rank-math-link">基礎網頁</a>抓下來顯示其程式碼。</li></ol>



<pre><code class="python">import requests
from bs4 import BeautifulSoup

res = requests.get("https://mofanpy.com/static/scraping/basic-structure.html")
soup = BeautifulSoup(res.text, "html.parser")
print(soup.prettify())  #輸出排版後的HTML內容5x
</code></pre>



<p class="wp-block-paragraph">若輸出結果為，即為安裝完成！</p>



<pre class="wp-block-code"><code>&lt;!DOCTYPE html&gt;
&lt;html lang="cn"&gt;
 &lt;head&gt;
  &lt;meta charset="utf-8"/&gt;
  &lt;title&gt;
   Scraping tutorial 1 | 莫烦Python
  &lt;/title&gt;
  &lt;link href="{{ static_url }}/js/description/tab_icon.png" rel="icon"/&gt;
 &lt;/head&gt;
 &lt;body&gt;
  &lt;h1&gt;
   爬虫测试1
  &lt;/h1&gt;
  &lt;p&gt;
   这是一个在
   &lt;a href="/"&gt;
    莫烦Python
   &lt;/a&gt;
   &lt;a href="/tutorials/data-manipulation/scraping/"&gt;
    爬虫教程
   &lt;/a&gt;
   中的简单测试.
  &lt;/p&gt;
 &lt;/body&gt;
&lt;/html&gt;</code></pre>
</div></div>



<figure class="wp-block-image size-large is-style-default"><img loading="lazy" decoding="async" width="1024" height="683" src="https://dragongo.co/wp-content/uploads/2021/05/image-4-1024x683.png" alt="image 4" class="wp-image-983" title="安裝BeautifulSoup教學(環境：Visual Studio Code) 14" srcset="https://dragongo.co/wp-content/uploads/2021/05/image-4-1024x683.png 1024w, https://dragongo.co/wp-content/uploads/2021/05/image-4-300x200.png 300w, https://dragongo.co/wp-content/uploads/2021/05/image-4-768x512.png 768w, https://dragongo.co/wp-content/uploads/2021/05/image-4-1536x1024.png 1536w, https://dragongo.co/wp-content/uploads/2021/05/image-4-1140x760.png 1140w, https://dragongo.co/wp-content/uploads/2021/05/image-4.png 1800w" sizes="(max-width: 1024px) 100vw, 1024px" /></figure>



<figure class="wp-block-image size-large is-style-default"><img loading="lazy" decoding="async" width="1024" height="683" src="https://dragongo.co/wp-content/uploads/2021/05/image-5-1024x683.png" alt="image 5" class="wp-image-985" title="安裝BeautifulSoup教學(環境：Visual Studio Code) 15" srcset="https://dragongo.co/wp-content/uploads/2021/05/image-5-1024x683.png 1024w, https://dragongo.co/wp-content/uploads/2021/05/image-5-300x200.png 300w, https://dragongo.co/wp-content/uploads/2021/05/image-5-768x512.png 768w, https://dragongo.co/wp-content/uploads/2021/05/image-5-1536x1024.png 1536w, https://dragongo.co/wp-content/uploads/2021/05/image-5-1140x760.png 1140w, https://dragongo.co/wp-content/uploads/2021/05/image-5.png 1800w" sizes="(max-width: 1024px) 100vw, 1024px" /></figure>



<p class="wp-block-paragraph">相關參考資料：<br><a aria-label="[Python爬蟲教學]7個Python使用BeautifulSoup開發網頁爬蟲的實用技巧 (opens in a new tab)" href="https://www.learncodewithmike.com/2020/02/python-beautifulsoup-web-scraper.html" target="_blank" rel="noreferrer noopener" class="rank-math-link">[Python爬蟲教學]7個Python使用BeautifulSoup開發網頁爬蟲的實用技巧</a><br><a aria-label="BeautifulSoup中文官方資料 (opens in a new tab)" href="https://www.crummy.com/software/BeautifulSoup/bs4/doc.zh/" target="_blank" rel="noreferrer noopener" class="rank-math-link">BeautifulSoup中文官方資料</a><br><a href="https://mofanpy.com/tutorials/data-manipulation/scraping/beautifulsoup-basic/" target="_blank" aria-label="BeautifulSoup 解析網頁: 基礎 (opens in a new tab)" rel="noreferrer noopener" class="rank-math-link">BeautifulSoup 解析網頁: 基礎</a></p>



<p class="wp-block-paragraph"><br></p>
]]></content:encoded>
					
					<wfw:commentRss>https://dragongo.co/%e5%ae%89%e8%a3%9dbeatifulsoup%e6%95%99%e5%ad%b8%e7%92%b0%e5%a2%83%ef%bc%9avisula-studio-code/feed/</wfw:commentRss>
			<slash:comments>3</slash:comments>
		
		
			</item>
		<item>
		<title>如何使用Python的BeautifulSoup模組分析網頁中的標籤(CSS)？</title>
		<link>https://dragongo.co/%e5%a6%82%e4%bd%95%e4%bd%bf%e7%94%a8python%e7%9a%84beautifulsoup%e6%a8%a1%e7%b5%84%e5%88%86%e6%9e%90%e7%b6%b2%e9%a0%81%e4%b8%ad%e7%9a%84%e6%a8%99%e7%b1%a4css%ef%bc%9f/</link>
		
		<dc:creator><![CDATA[龍冥]]></dc:creator>
		<pubDate>Fri, 14 May 2021 12:30:13 +0000</pubDate>
				<category><![CDATA[Python]]></category>
		<category><![CDATA[beautifulsoup]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[visual studio code]]></category>
		<category><![CDATA[網頁爬蟲]]></category>
		<category><![CDATA[自學程式]]></category>
		<guid isPermaLink="false">https://dragongo.co/?p=1007</guid>

					<description><![CDATA[講解如何用python的BeautifulSoup模組，找出網頁中特定的類別(class)。]]></description>
										<content:encoded><![CDATA[
<p class="wp-block-paragraph">若沒有安裝過lxml解析器，需先透過指令安裝</p>


<pre><code class="python">pip install lxml</code></pre>



<p class="wp-block-paragraph">前兩行先將BeautifulSoup以及urlopen函示庫匯入，因為網頁中包含中文字，因此讀取後會需要decode(&#8216;utf-8&#8217;)編碼。<br>再將html資料將其印出，網站來源為<a href="https://mofanpy.com/tutorials/data-manipulation/scraping/beautifulsoup-css/" target="_blank" aria-label="莫凡python (opens in a new tab)" rel="noreferrer noopener" class="rank-math-link">莫凡python</a>提供的<a href="https://mofanpy.com/static/scraping/list.html" target="_blank" aria-label="測試網站 (opens in a new tab)" rel="noreferrer noopener" class="rank-math-link">測試網站</a></p>



<pre><code class="python">from bs4 import BeautifulSoup
from urllib.request import urlopen

# if has Chinese, apply decode()
html = urlopen("https://mofanpy.com/static/scraping/list.html").read().decode('utf-8')

print(html)</code></pre>



<p class="wp-block-paragraph">這段程式碼將class類別中為month的資料解析出來，並透過print(m.get_text())將有使用month這個類別的標籤全部顯示。</p>



<pre><code class="python">from bs4 import BeautifulSoup
from urllib.request import urlopen

# if has Chinese, apply decode()
html = urlopen("https://mofanpy.com/static/scraping/list.html").read().decode('utf-8')
# use class to narrow search
#尋找指定的class類別
soup = BeautifulSoup(html, features='lxml')
month = soup.find_all('li',{"class":"month"})
for m in month:
    print(m.get_text())</code></pre>
]]></content:encoded>
					
		
		
			</item>
	</channel>
</rss>
