うっかり太郎のメモ帳
python 何もわからない経験半年太郎
# listの中身を検索する
import re
reply = ['working on 100 object(s).', '100 object(s) were update.']
S = [s for s in reply if re.search(r'^\s{1,}\s\dobject\(s\)\swere\supdate\.$', s)]
if S:
return 'OK'
else:
return 'NG'
# dictに追加(使わないけどメモ)
# hogeはiniから取得とかなんかそういうの
cmd_list = 'なんか文字{0}'.format(hoge)
AAA = ['key1', 'key2', 'key3']
cmd = []
for i in AAA:
cmd += cmd_list[i].splitlines()
dict = dict(zip(AAA, cmd))
この記事が気に入ったらサポートをしてみませんか?