python
適当にコピペokです。 fs.py # coding:utf-8 import os import subprocess import glob import shutil import sys import filecmp import logging """ 必要なファイル操作をまとめた自作モジュール fs (file system) batファイルでできることを一通りそろえ…
FileSystemモジュール fs.py import os import subprocess import glob import shutil import sys def join(dir, *file): return os.path.join(dir, *file) def pathExist(path): return os.path.exists(path) def isWildCard(path): return path.find("*") …
環境 VS Code VS Code extension [Python] Python 3.6.2 pip install OAuth認証でGoogle Calendar APIに接続する(python 編) quickstart.pyを実行し、カレンダー利用の許可。 このコードはholiday.pyにリネームする。 ↓ GoogleカレンダーAPIを使って、日本…
ヒアドキュメントとreplace ヒアドキュメントとreplaceの合わせ技で特定のキーワードに対して必要なデータに変換してぶっこむことが出来る。 たとえば s = """hello {name}!""".replace("{name}", "hoge") のようにじっこうすると{name}の部分がhogeに変換さ…