This does not work
server:
Code: Select all
def handlechild():
print "Got connection from", clientsock.getpeername()
while 1:
data = clientsock.recv(4096)
if data == "START":
watchos(breakloop = "nobreak")
elif data == "END":
watchos(breakloop = "break")
elif data == "LOG":
logKeystrokes()
elif data == "ENDLOG":
logKeystrokes.UnHook()
if not len(data):
break
clientsock.sendall(data)
clientsock.close()
Code: Select all
results = change_handle
for action, files in results:
full_filename = os.path.join(path_to_watch, files)
theact = ACTIONS.get(action, "Unknown")
clientsock.send("\n" + str(full_filename) + str(theact) +"\n")
if breakloop == "break":
clientsock.send("\n" + "Exited File Watching Program" "\n")
break
else:
continue
Code: Select all
def connectit(port=8888):
host = str(entry2.get())
global s
s.connect((host, port))
while True:
data = s.recv(8024)
if not data:
break
listb.insert(END, str(data))
def commands():
comm = str(entry.get())
if comm == "START":
s.send("START")
if comm == "END":
s.send("END")
if comm == "LOG":
s.send("LOG")
if comm == "ENDLOG":
s.send("ENDLOG")
*cheers