# _*_coding:utf-8_*_
# 客户端程序

from socket import *
import time
from sys import exit
import notebooknets

def main():
    BUF_SIZE = 65565
    ss_addr = ('127.0.0.1', 8800)
    cs = socket(AF_INET, SOCK_DGRAM)
    notebooknets.printhistory()
    while True:
        global data
        data = raw_input('今日记录，请输入（输入'quit'退出程序）：')
        if data == 'quit':
            exit(0)
        else:
            cs.sendto(data, ss_addr)
            data, addr = cs.recvfrom(BUF_SIZE)
            print "Data: ", data  
            notebooknets.save(data)      
    cs.close

if __name__ == '__main__':
    main()

@@ -307,22 +307,20 @@
 %E5%BD%95%EF%BC%8C%E8%AF%B7%E8%BE%93%E5%85%A5%EF%BC%88%E8%BE%93%E5%85%A5
-'
 quit
-'
 %E9%80%80%E5%87%BA%E7%A8%8B%E5%BA%8F%EF%BC%89%EF%BC%9A')

Update notebooknetc.py