Thread: PHP to Python?
View Single Post
Old Sep 22nd, 2007, 10:54 AM   #4
SaturN
Programmer
 
Join Date: Apr 2005
Location: Uk
Posts: 68
Rep Power: 4 SaturN is on a distinguished road
Firstly the first code (PHP) Is not mine, but it is what I need for the code that I am writing in python, as for the indentation comment how that is relevant to it being poorly spaced on a forum I find irellevant within my code it works.

As for my sig, I can see sarcasm is wasted to your wise wit...
I came here asking for help not for a debate.

Your code that you have posted is pretty much a match to mine but thanks anyway..

The code should be simple to understand both in the PHP and Python.
It sends status to a socket, gets the data back from the socket, BUT I was hoping for a if no new data, wait and check again sort of thing, because at the moment some of the data that should be there is not! And from what I can interprit from the PHP if looks like if new data is not found it waits, then gets more, so maybe this is what my code was missing then split the data from the server in to chunks...

Sorry if it sounds like I am biting back at anyone in the above, but
"Hanging on the sugar tit is not generally considered to qualify" thought this was a 'Programming Forum' not a 'Lessons to Life Forum'....

def Update():
    global chunks
    s.send("\\status\\")
    final = False
    while(final != True):
        data = s.recv(1024)
        if(data.find("final\\") != False): final = True
    chunks = data.split('\\')

But I am unsure if this gets all the data from the server.
Cheers for anyone willing to help and not give bites...
__________________
while me is alive:
	make(life,simple)
SaturN is offline   Reply With Quote