# coding:utf-8

# try:
# 	f = open('mytext.txt','w')   #打开要写入的文件
# 	while True:
# 		s = input('请输入字符串（按Q键结束：')
# 		if s.upper() == 'Q':
# 			break
# 		f.write(s +'\n')
# except KeyboardInterrupt:
# 	print('程序中断！（Ctrl+C键）')
# finally:
# 	f.close()

try:
	fh = open('testfile.txt','w')
	