![]() |
|
|
|
Thread Tools | Display Modes |
|
|
|
|
#1 |
|
Programmer
Join Date: Apr 2005
Location: Uk
Posts: 68
Rep Power: 4
![]() |
Is there anyone that is able to convert this small php snippet
fputs($sock,"\\status\\"); $gotfinal=False; $data="";
socket_set_timeout($sock,0,200000);
$starttime=Time();
while(!($gotfinal==True||feof($sock))) {
if(($buf=fgetc($sock))==FALSE) usleep(100);
$data.=$buf;
if(strpos($data,"final\\")!=False) $gotfinal=True;
if((Time() - $starttime)>2) {
$gotfinal=True;
}
}
fclose($sock);
$chunks=split('[\]',$data);to Python?? I've got global chunks
s.send("\\status\\")
final = False
while(final != True):
data = s.recv(1024)
if (len(data) <= 0): sleep(1); data = data, s.recvfrom(1024)
if(data.find("final\\") != False): final = True
chunks = data.split('\\')But as you'll notice tis is not really a good match !! ![]() Thanks for anyone that is able to help! It would be greatly appriciated!! :banana:
__________________
while me is alive: make(life,simple) |
|
|
|
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Beginers Python Tutorial | Beegie_B | Python | 15 | Jul 28th, 2006 12:43 PM |
| [tutorial] Python for programming beginners | coldDeath | Python | 30 | Dec 14th, 2005 12:35 PM |
| Convert Python script to C++ code | clanotheduck | Python | 17 | Sep 25th, 2005 9:55 AM |
| Advanced Python Tricks | Arevos | Python | 19 | Sep 24th, 2005 8:39 AM |
| Python - A Programmers Introduction | coldDeath | Python | 17 | Aug 19th, 2005 1:41 PM |