<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/"><channel><title>Python on Lin's Blog</title><link>https://coder.tw/categories/python/</link><description>Recent content in Python on Lin's Blog</description><generator>Hugo</generator><language>zh-tw</language><lastBuildDate>Sun, 12 Mar 2023 13:25:45 +0000</lastBuildDate><atom:link href="https://coder.tw/categories/python/index.xml" rel="self" type="application/rss+xml"/><item><title>How to Ignore Python Warning</title><link>https://coder.tw/posts/how-to-ignore-python-warning/</link><pubDate>Sun, 12 Mar 2023 13:25:45 +0000</pubDate><guid>https://coder.tw/posts/how-to-ignore-python-warning/</guid><description>&lt;p&gt;在寫 Python 時偶爾會遇到一些無法解決或意義不大的警告訊息（Warning），例如前陣子使用 OpenPyxl 時它常常會提醒我：&lt;code&gt; warn("Workbook contains no default style, apply openpyxl's default")&lt;/code&gt; ，這個 Warning 是提醒 OpenPyxl 會自動套用預設樣式到我載入的檔案，至於要如何解決這個 Warning？ 你需要用 Office 打開這個 Excel 檔案，重新存檔。像這就是一個對當下場景的我來說意義不大的警告訊息，因為我的程式是拿 Excel 檔的內容來使用，樣式對我沒有影響。&lt;/p&gt;
&lt;p&gt;遇到警告訊息時，我的習慣還是會檢視並思考是什麼原因導致這個警告訊息，如果確認對我沒有影響，我會把它們從程式裡忽略掉，而不是依靠開發者的大腦去記得「這個警告訊息不重要」，並不是單純的眼不見為靜，而是為了養成良好的「看到警告訊息都要去處理」的習慣。&lt;/p&gt;</description></item><item><title>如何用 Python 印出進度條的效果</title><link>https://coder.tw/posts/python-print-progress-bar/</link><pubDate>Sat, 18 Feb 2023 16:16:32 +0000</pubDate><guid>https://coder.tw/posts/python-print-progress-bar/</guid><description>&lt;figure class="wp-block-image size-full"&gt;&lt;img src="https://pub-6c026d2742d14927bfa2d850c31eac91.r2.dev/wp-content/uploads/2023/02/CleanShot-2023-02-18-at-16.00.47.gif" alt="" class="wp-image-7786"/&gt;&lt;/figure&gt;
&lt;p&gt;前陣子在開發實驗室的零食結帳工具時學到的小技巧，如果想在 Terminal 上作出類似 進度條 的效果，也就是「在原地印出文字，移除舊的文字」的話，可以參考這篇文章（其他語言也是相同原理）&lt;/p&gt;</description></item><item><title>如何在Linux裡面手動安裝Python並且避免yum不能運作的問題</title><link>https://coder.tw/posts/linux-install-python-manually-keep-yum/</link><pubDate>Fri, 19 Aug 2011 08:00:45 +0000</pubDate><guid>https://coder.tw/posts/linux-install-python-manually-keep-yum/</guid><description>&lt;p&gt;之前曾經寫過一個程式可以自動備份Linux裡的重要資料並且上傳到Google Storage，當時用的語言是Python 2.7，但是Linux裡面內建的Python是2.4，而且就算你用yum去進行升級，最高也只會到2.4，這時候你如果想要安裝更新版的Python就只能自行編譯了，下面將用Python 3.2進行教學&lt;/p&gt;</description></item><item><title>讓Python安裝模組變得更簡單～ easy_install使用教學+egg檔安裝教學</title><link>https://coder.tw/posts/python-easy-install-tutorial/</link><pubDate>Sun, 01 May 2011 16:50:04 +0000</pubDate><guid>https://coder.tw/posts/python-easy-install-tutorial/</guid><description>&lt;p&gt;&lt;a href="https://pub-6c026d2742d14927bfa2d850c31eac91.r2.dev/wp-content/uploads/2011/05/2011-05-01_170827.jpg"&gt;&lt;img class="aligncenter" title="2011-05-01_170827" src="https://pub-6c026d2742d14927bfa2d850c31eac91.r2.dev/wp-content/uploads/2011/05/2011-05-01_170827-540x352.jpg" alt="" width="540" height="352" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;大家都知道Python這套程式語言的特點就是它的擴充性極高，可以安裝一些第三方的模組來達到你想要的功能，例如你想要使用「中文」來寫程式的話可以安裝zhpy這個模組，但是安裝這些模組說難也還好，就是很麻煩，有些可能只要按下一步就好了，有些可能還要去調整系統的設定，在這裡要介紹一個程式叫做「easy_install」，它可以讓你的Pythonm樣安裝模組時變得很簡單，用法跟Linux的yum其實很類似，有了他你只需要一行指令就可以安裝好模組啦～ 另外easy_install還有一個功能就是可以幫你安裝所謂的egg格式&lt;/p&gt;
&lt;h2&gt;</description></item><item><title>【Python】踏入Python世界的第一步：HelloWorld(輸出文字與註解的寫法)</title><link>https://coder.tw/posts/python-hello-world-first-step/</link><pubDate>Sun, 20 Feb 2011 09:00:54 +0000</pubDate><guid>https://coder.tw/posts/python-hello-world-first-step/</guid><description>&lt;p style="text-align: center;"&gt;&lt;a href="https://pub-6c026d2742d14927bfa2d850c31eac91.r2.dev/wp-content/uploads/2011/02/2011-02-18_231056.jpg"&gt;&lt;img class="size-large wp-image-315 aligncenter" title="2011-02-18_231056" src="https://pub-6c026d2742d14927bfa2d850c31eac91.r2.dev/wp-content/uploads/2011/02/2011-02-18_231056-540x393.jpg" alt="" width="540" height="393" /&gt;&lt;/a&gt;&lt;/p&gt;
幾乎所有教程式語言的書籍，他的第一個練習程式都是HelloWorld，所謂的HelloWorld就是要讓程式輸出「HelloWorld」，而在這篇文章裡面我們會教大家寫出第一個Python的程式，並且簡單講解Python的一些用法</description></item><item><title>【Python】Python直譯器安裝教學</title><link>https://coder.tw/posts/python-interpreter-install-tutorial/</link><pubDate>Fri, 18 Feb 2011 22:01:26 +0000</pubDate><guid>https://coder.tw/posts/python-interpreter-install-tutorial/</guid><description>&lt;p style="text-align: center;"&gt;&lt;a href="https://pub-6c026d2742d14927bfa2d850c31eac91.r2.dev/wp-content/uploads/2011/02/2011-02-15_214318.jpg"&gt;&lt;img class="size-full wp-image-274 aligncenter" title="2011-02-15_214318" src="https://pub-6c026d2742d14927bfa2d850c31eac91.r2.dev/wp-content/uploads/2011/02/2011-02-15_214318.jpg" alt="" width="511" height="297" /&gt;&lt;/a&gt;&lt;/p&gt;
最近因為在玩Google Storage的關係，所以就把我塵封已久的Python書拿出來看了一下，順便搭配Google Code上的說明文件，寫了一個自動備份的小程式，目前這程式還很簡單所以先不公布出來，不過寫了這個小程式之後才讓我發現Python是一個蠻簡單的程式語言，在入手的難易度還有嚴謹度上面跟VB不相上下，但是在囉嗦程度上面Python卻贏過VB（我是說VB比較囉嗦的意思XD），例如在VB裡面的判斷式要寫成if.....then.......end if，可是在Python只要if....:就完成了，還有在Python裡面縮排很重要，沒縮排好就會導致程式無法執行，因為他的編譯器是利用縮排來判斷你的選擇結構、迴圈這些東西是否執行完畢，我個人還蠻建議新手來學Python的說，可以讓你寫出很漂亮的程式碼～</description></item></channel></rss>