pythonのsubprocess.runでrepository = subprocess.run(“ls -1t test/html | head -1”, shell=True, capture_output=True, text=True).stdout.strip()を実行することで、一番新しいファイルの名前を取得することができた
pythonのsubprocessでsubprocess.run(f”echo ‘{cmd}’ >> test.txt”, shell=True)を実行することで、cmd変数に格納された文字列をtest.txtファイルに書き出すことができた