atmosphereのアンドロイド日記

方向性がわからないです

アカウント情報とかを保存するプログラムを書いた

夏バテの後遺症もあって、メールのアカウントとかパスワードとかの記憶が飛んでしまいました。このままではやばいなと思い、嫌々ながらそれ対策のプログラムを書きました。

機能としてはタイトルを入力、回数、key、valueという感じでコマンドプロンプトから入力した内容をファイルに書き出すものです。

自分の覚えの悪さに嫌気がさして憂鬱な気分になりました。

ソース

 

 

# -*- coding: utf-8 -*-

def acc_log():
	try:
		store = {}
		f = open('acc_log.txt', 'a', encoding = 'utf-8')

		print('Please title.')
		inp_title = str(input())
		f.write('--------{}--------\n'.format(inp_title))
		print('Please enter the number of times')

		number_of_times = int(input())

		for i in range(number_of_times):
			print('Please input name.')
			inp_keys = str(input())
			print('{} of content.'.format(inp_keys))
			inp_str = str(input())

			if (inp_keys or inp_str) is '': raise
			store[inp_keys] = inp_str
			
		for i_keys, i_str in store.items():
			hurriedly = [i_keys, i_str]
			f.write('{}\n'.format(hurriedly))

	except: pass

	finally: f.close()


if __name__ == '__main__':

	acc_log()