Skip to content

Benjr.tw

  • Linux
    • Stress & Performance
    • Hardware Info
    • System Monitor
    • Security
    • Desktop
    • PXE
    • Filesystem Hierarchy Standard
    • Linux 開機選項
    • Linux Package Manager
    • 備份 Backup
  • Virtualization
    • Docker & Podman
    • CoreOS
  • NAS/SAN
  • Programming Language
    • Python
    • Bash shell script
    • Perl
    • PHP
    • Node.JS
    • VBA
    • javascript
    • Power Query
    • PowerShell
  • WordPress
  • DataBase
    • 資料庫安裝
    • 資料庫語法
    • SQLite
    • MariaDB JSON

Programming Language

Python – logging 類別

2022-05-252022-05-31 adminLinux, Programming Language, Python, RedHat / CentOS

Loading

測試環境為 CentOS 8 x86_64 (虛擬機) 參考文章 – https://editor.leonh.space/2022/python-log/ 與 https://iter01.com/578914.html 透過 print 函數可以把執行 python 的訊息顯示在文字命令列上, […]

Read more

Python – raise exception

2022-05-242022-09-02 adminLinux, Programming Language, Python, RedHat / CentOS

Loading

測試環境為 CentOS 8 x86_64 (虛擬機) 如果要在發生錯誤時直接中斷掉程式,可以使用 raise 來發起例外 (exception) 這樣程式就會中斷執行並在命令列上列印出相對應的錯誤訊息. raise 後面接著 異常類名稱 (描述信息),其 異常類名稱 請參考官方網站說明 : htt […]

Read more

Python – File 物件 & Open 函式

2022-05-242022-07-07 adminLinux, Programming Language, Python, RedHat / CentOS

Loading

測試環境為 CentOS 8 x86_64 (虛擬機) 參考文章 – https://medium.com/ccclub/ccclub-python-for-beginners-tutorial-bf0648108581 Python 提供 檔案物件 file object 來存取檔案. 開啟檔案 […]

Read more

Python – Class 的 Static / Class / Abstract Method

2022-05-232022-06-24 adminLinux, Programming Language, Python, RedHat / CentOS

Loading

測試環境為 CentOS 8 x86_64 (虛擬機) 參考文章 – https://www.maxlist.xyz/2019/12/08/python-class-static-abstract-method/ Class 不同的 Static / Class / Abstract M […]

Read more

Python – docstring

2022-05-192022-05-19 adminLinux, Programming Language, Python, RedHat / CentOS

Loading

測試環境為 CentOS 8 x86_64 (虛擬機) 在 function 的第一行可以使用一段字串(需使用 ”’ String ”’ 或是 “”” String “””)來描述 […]

Read more

Python – _ (底線) 與 _ _(雙底線)

2022-05-182022-07-22 adminLinux, Programming Language, Python, RedHat / CentOS

Loading

第一次看到 Python 的 Code 時候發現寫法使用很多 _ (底線) 與 _ _(雙底線),原來是有其建議規定的. 參考文章 – https://medium.com/bits-to-blocks/python%E4%B8%AD%E7%9A%84underscore-%E8%88% […]

Read more

Python – __init__ , __str__ , __repr__

2022-05-182022-07-21 adminLinux, Programming Language, Python, RedHat / CentOS

Loading

測試環境為 CentOS 8 x86_64 (虛擬機) __init__ , __str__ , __repr__ 是 Class 預設 method .下面來看一下使用的時機點. object.__init__(self[, …]) – https://docs.pytho […]

Read more

Python – @Property & __attribute

2022-05-182023-05-22 adminLinux, Programming Language, Python, RedHat / CentOS

Loading

測試環境為 CentOS 8 x86_64 (虛擬機) 使用 Property 時可以把 類別(Class) 的 方法 (Method) 轉變成存取 屬性 (Attribute) 包含 setter , getter 與 deleter 等方法 (Method) , 參考文章 – htt […]

Read more

Python – instance attribute & class attribute

2022-05-172022-05-17 adminLinux, Programming Language, Python, RedHat / CentOS

Loading

測試環境為 CentOS 8 x86_64 (虛擬機) Class 的 屬性 (Attribute)是用來存放 Object 的資料.屬性 (Attribute) 有分 實例屬性(instance attribute) 與 類別屬性(class attribute). 實例屬性 (instance […]

Read more

Python – Try-except , else & finally statement

2022-05-162022-09-02 adminLinux, Programming Language, Python, RedHat / CentOS

Loading

測試環境為 CentOS 8 x86_64 (虛擬機) Try-except statement 格式如下,通常會搭配 raise exception – https://benjr.tw/104314 來使用. 下面範例輸入兩整數,並透過 Try-except 來避免錯誤發生. exc […]

Read more

文章導覽

較舊的文章
較新的文章

近期文章

  • Windows – Network Sharing + Port forwarding to VM
  • Ansible – gather facts
  • Ansible – host_vars 定義特定的變量
  • Ansible 範例 – Chrony daemon
  • Ubuntu NTP Client 校時設定

近期留言

  • 「Jackson2734」於〈Ubuntu NTP Client 校時設定〉發佈留言
  • 「w」於〈Ubuntu 16.04 Server PXE 安裝〉發佈留言
  • 「admin」於〈TCP/IP 常見封包〉發佈留言
  • 「stu」於〈TCP/IP 常見封包〉發佈留言
  • 「student」於〈Linux command – tcpdump〉發佈留言

分類

其他操作

  • 登入
  • 訂閱網站內容的資訊提供
  • 訂閱留言的資訊提供
  • WordPress.org 台灣繁體中文
  • Privacy Policy
  • 隱私權政策
Powered by WordPress | Theme: Astrid by aThemes.