# 메모장
import tkMessageBox
import os.path
filename = "data.txt"
text.delete(1.0, END)
textData = text.get(1.0, END).encode('cp949')
tempFileData = ""
if os.path.exists(filename):
fp = open(filename, 'r')
tempFileData = fp.read()
fp.close()
fp = open(filename, 'w')
fp.write(textData)
fp.write(tempFileData)
fp.close()
tkMessageBox.showinfo("Information","http://chobocho.com\nVersion 0.1")
#----------------------------------------------------------
# main
if __name__ == "__main__":
text = Text(root, width=50, height = 20)
text.pack()
clear_button = Button(root, text="Clear", command = ClearText)
info_button = Button(root, text="Info", command = ShowInfo)
clear_button.pack(side=RIGHT)
save_button.pack(side=RIGHT)
'Coding > Python 삽질기' 카테고리의 다른 글
간단한 메모장2 (0) | 2008.09.17 |
---|---|
Fractal Tree (0) | 2008.06.21 |
파일을 HEX 값으로 보여 주는 소스 (0) | 2008.05.19 |