(1) ターミナル.appを起動 - Spotlightで「ターミナル.app」と入力 (2) フォルダを作成したいディレクトリに移動 - コマンド「cd (パス)」を実行 (3) Pythonの対話環境(シェル)を起動 - コマンド「python3」を実行 (4) 上記プログラムを記入して実行。なお入力後に2回[Enter ...
os.path.join (folder, filename) ensures the path is correct for the system. On Windows, it uses backslashes (reports\summary.txt); on Linux and macOS it uses forward slashes (reports/summary.txt).