顯示具有 pathlib 標籤的文章。 顯示所有文章
顯示具有 pathlib 標籤的文章。 顯示所有文章

2022年9月30日 星期五

Rename a file using Python pathlib module

Rename a file using Python pathlib module

 from pathlib import Path


path = Path("target file")


target = path.with_name(path.name.replace("08",'09'))


path.rename(target)

Python program to display calendar

# Python program to display calendar of given month of the year # importing calendar module for calendar operations import calendar # set t...