0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

Pythonの出力結果をLinuxコマンドで変数に格納する

Last updated at Posted at 2022-11-10

Pythonの出力結果をLinuxコマンドで変数に格納する

以下のコマンドですることが可能です../sample.pyを実行したいスクリプトに変更してください.

result=`./sample.py`
echo ${result}

なお,以下のように引数を与えることも可能.

result=`./sample.py 1 2`
echo ${result}
0
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?