Skip to main content

Posts

Showing posts from February, 2021

Python 日期與時間的處理

Image
Python 日期與時間的處理 Python 日期與時間的處理 ¶ 在 Python 中,常見處理日期與時間的套件,如下: time datetime relativedelta calendar    引用方式,如下:   import time from datetime import datetime from dateutil.relativedelta import relativedelta import calendar time.time() 函數 ¶ time.time() 可以傳回從 1970/1/1 00:00:00 算起至今的秒數: In [1]: # 匯入 time 模組 import time # 從 1970/1/1 00:00:00 至今的秒數 seconds = time . time () # 列印結果 print ( seconds ) 1613001756.3572578 time.time() 通常是用來作為時間戳記,例如測量程式執行時間。 In [6]: import time # 紀錄起始時間 start_time = time . time () # 撰寫程式,例如:迴圈執行 a = 0 for _ in range ( 10000000 ): a += 1 # 紀錄結束時間 end_time = time . time () # 將結束時間減去起始時間,等於執行時間 time_cost = end_time - start_time # 顯示執行時間 print ( f "Time Cost: { time_cost } seconds" ) ...
Newer Posts Home Older Posts

數位影像處理:最佳化處理策略之快速消除扭曲演算法

Image

寫作:波蘭文學習之旅:1-1. 波蘭文字母與發音(注音版)

Image

Python 日期與時間的處理

Image

Visual Basic 6.0 (VB6) 程式語言案例學習 (10. 條碼列印程式)

Image

Visual Basic .Net (VB.Net) 程式語言案例學習 (06. 題庫測驗系統)

Image

修復損毀的 SQLite DB 資料庫

Image

用10種程式語言做影像二值化(Image binarization)

解決 ValueError: If using all scalar values, you must pass an index

Image

Visual Basic 6.0 (VB6) 程式語言案例學習 (04. 人事考勤管理系統)

Image

Visual Basic 6.0 (VB6) 程式語言案例學習 (07. 收據列印程式)

Image