AppleScript → Shell → Python で、trimする。 log my trim({text_:" test "}) on trim(args) set {text_:aText}
カテゴリー: Python
【Python】別のpyファイルの関数を呼ぶ
com / test.py def test1(arg1): return "test = " + arg1 呼び出し元 from com import test rtn = test.test1(&
【Python】Shell、Apple Script に引数を渡して戻り値を取得する方法
Python から Shell 経由で Apple Script のコードを使う。 Pythonファイル(test.py) import subprocess if __name__ == '__main__&
【Shell】Python に引数を渡して戻り値を取得する方法
Python に引数を渡して戻り値を取得する Shell コマンド test1=$(python test.py 123) echo $test1 test.py import sys arg1 = "&quo
【Python】path.glob で複数の拡張子を検索する方法(大文字小文字の区別付き)
Pyrhon で、path.glob を使って、ファイルを拡張子でフィルタリングしたい時は、 from pathlib import Path path = Path(image_dir) images = sorted
【Python】Automator のクイックアクション からの 「Google Photos API を使用した画像の自動アップロード」
こちらのサイトを参考にして、 Python を使って、Google Photos に画像をアップロードするプログラム(google_photos_upload.py)を書いておく。 Google Cloud API から
【Python】日本語文字を使った時のエラー
Pythonのコードの中で日本語を使うとエラーが出た。 アクション“シェルスクリプトを実行”でエラーが起きました: “ File "○○○.py", line 19 SyntaxError: Non-
【Python】pip で SSL関連のエラー
pip でモジュールを追加しようとしたら、以下のような警告文が出た。 WARNING: pip is configured with locations that require TLS/SSL, however the