2018-06-19から1日間の記事一覧

f表記がPython3.6から使える

item1 = 'apple' item2 = 'bananas' item3 = 'grapes' print('At the grocery store, I bought some {0} and {1} and {2}.'.format(item1,item2,item3)) print('At the grocery store, I bought some {0} and {1} and {2}.'.format('apple',2,3))#intも入れ…

shelve したあと、中身みたいとき。

# 変数専用ファイルにデータを保管 pickle モジュールを使う import shelve shelve_file = shelve.open('friend') my_friend = ['A_san', 'B_san', 'C_san'] shelve_file['my_friend'] = my_friend print(shelve_file.keys) a =list(map(str,shelve_file)) p…