Skip to content

Instantly share code, notes, and snippets.

@hamaguchi-amago
Last active October 4, 2019 10:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hamaguchi-amago/4d5616abac392a2405676d488913d536 to your computer and use it in GitHub Desktop.
Save hamaguchi-amago/4d5616abac392a2405676d488913d536 to your computer and use it in GitHub Desktop.
引数の受け取り
# -*- coding: utf-8 -*-
import sys
args = sys.argv
print(args) #引数をすべて表示
for i in range(len(args)):
list_item = args[i]
print('{0}:{1}'.format(i, list_item)) #ループして1件1件表示
@hamaguchi-amago
Copy link
Author

ブログの記事で作成しました。
興味のある方はご覧ください。

【Python】コマンドライン引数の取得方法
https://neko-py.com/python-argument-get

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment