| 1 |
ninoborges |
8 |
## NS_MOTD_server.py
|
| 2 |
|
|
## This program will act as the server to the NS_MOTD messaging system between Sara and Myself.
|
| 3 |
|
|
## It will allow us to send messages regarding this pc and our profiles back and forth by
|
| 4 |
|
|
## displaying a Message of the Day each time the other logs in. This program will create the
|
| 5 |
|
|
## files that the server will then read.
|
| 6 |
|
|
## EBorges
|
| 7 |
|
|
## 4.21.03
|
| 8 |
|
|
|
| 9 |
|
|
import os,sys
|
| 10 |
|
|
from Tkinter import *
|
| 11 |
|
|
import tkSimpleDialog
|
| 12 |
|
|
|
| 13 |
|
|
root = Tk()
|
| 14 |
|
|
user = sys.argv[1]
|
| 15 |
|
|
messagesDir = r'C:\Documents and Settings\All Users\Documents\NS_Messages'+ '\\'+ user
|
| 16 |
|
|
message = tkSimpleDialog.askstring("Message Sender", "What message would you like to send to %s ?"% user, parent = root)
|
| 17 |
|
|
messageCount = len(os.listdir(messagesDir))
|
| 18 |
|
|
messageCount = messageCount + 1
|
| 19 |
|
|
messageCount = str(messageCount)
|
| 20 |
|
|
if message:
|
| 21 |
|
|
o = open(messagesDir + '\\' + 'test%s.txt'% messageCount,'w')
|
| 22 |
|
|
o.write(message)
|
| 23 |
|
|
o.close()
|
| 24 |
|
|
root.mainloop()
|