python -m http.server 8888
ts = os.path.getmtime(file_path) print(ts) # 1657734360.18843 print(type(ts)) # <class 'float'> # datetime型に変換 d = datetime.datetime.fromtimestamp(ts)
print(html.unescape("吴 ほげほげ"))
glob(r"order_pdf\**\*.*", recursive=True)
import locale locale.setlocale(locale.LC_CTYPE, "Japanese_Japan.932") まだエラーが表示される場合はこちらも試してください。 locale.setlocale(locale.LC_CTYPE, "English_United States.932")
import calendar print calendar.monthrange(2014,12)
dt_now: date = datetime.now() # type: ignore dt_uri: date = parser.parse(a.expected_sales_date) # type: ignore td: timedelta = dt_uri - dt_now if td.days < 30: ...
f"{s:0>7}" または s.zfill(7)
list = ["text1", "text2", "text3"] string = "\n".join(list)
file_name = re.sub(r'[\\|/|:|?|.|"|<|>|\|]', '-', file_name)
→PDF関連へ
import csv rows =[]; #BOMありUTF8 なのでエンコーディングは utf-8-sig とした with open('./Anken.csv', 'r', encoding='utf-8-sig', errors='strict', newline='') as csv_file: f = csv.DictReader(csv_file, delimiter=',', doublequote=True, lineterminator='\r\n', quotechar='"', skipinitialspace=True) for row in f: rows.append(row) #破壊型ソートです rows.sort(key=lambda x:x['JOBNo.']) for row in rows: print(row['JOBNo.'], row['案件名'])
error: Multiple top-level packages discovered in a flat-layout: ['xxx'...]. To avoid accidental inclusion of unwanted files or directories, setuptools will not proceed with this build. If you are trying to create a single distribution with multiple packages on purpose, you should not rely on automatic discovery. Instead, consider the following options: 1. set up custom discovery (`find` directive with `include` or `exclude`) 2. use a `src-layout` 3. explicitly set `py_modules` or `packages` with a list of names To find more information, look for "package discovery" on setuptools docs.
"justMyCode": false,