
だから私はこのコマンドを実行しています
os.system(f"screen -S Uploader -d -m bash -c 'bash uploader.sh 2>&1 | tee uploader_log'")
。
Uploader.shは正常に表示されるPythonスクリプトを実行します。ただし、from ptpython.repl import embed; embed(globals(), locals())
IndexError を受け取ると実行されます。そのため、エラーが発生する前には正常に表示されていたのがエラーが発生し、今は図のように奇妙に表示されています。
回避策がありますか? ptpythonオートコンプリート機能に関連していると思いますか? os.system('touch test') を実行でき、repl で正しく実行されます。私を悩ませるのは、それを見せるだけです。
参考までにうまくscreen -S test -d -m bash -c 'python3.12 -c "from ptpython.repl import embed; embed(globals(), locals())"'
動作します。
ただし、screen -S test -d -m bash -c 'bash test.sh 2>&1 | tee log'
test.sh に含めると表示がおかしくなります。python3.12 -c 'from ptpython.repl import embed; embed(globals(), locals())'