Die Suche ergab 6 Treffer

von _blubber_
Samstag 22. August 2009, 21:12
Forum: Allgemeine Fragen
Thema: convert frage von c nach python
Antworten: 16
Zugriffe: 3655

eine frage habe ich noch ich mach ein
self.uds = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM)
self.uds.connect(("/tmp/q_socket"))
self.uds.settimeout(2.0)

und bekomme als fehler
/usr/lib/python2.5/site-packages/twisted/internet/defer.py:328:_runCallbacks
<string>:1:settimeout
/usr/lib ...
von _blubber_
Montag 10. August 2009, 12:20
Forum: Allgemeine Fragen
Thema: convert frage von c nach python
Antworten: 16
Zugriffe: 3655

so sorry das ich mich erst jetzt melde hatte inet probleme

1000 thx jetzt rennt alles bestens hatte probleme vom umstzen vom c syntax in python
von _blubber_
Mittwoch 5. August 2009, 23:51
Forum: Allgemeine Fragen
Thema: convert frage von c nach python
Antworten: 16
Zugriffe: 3655

ich werd mit python ned warm in c funktioniert das


#include <sys/socket.h>
#include <sys/un.h>
#include <stdio.h>
#include <unistd.h>

#define Q_SOCKET "/tmp/q_socket"

int main() {

int sockfd;
int i;
unsigned char buf[7];
unsigned char rbuf[4];

buf[0] = (0x001 >> 8) & 0xff;
buf[1 ...
von _blubber_
Mittwoch 5. August 2009, 15:29
Forum: Allgemeine Fragen
Thema: convert frage von c nach python
Antworten: 16
Zugriffe: 3655

ich habe leider nur Python 2.5.1
von _blubber_
Mittwoch 5. August 2009, 13:12
Forum: Allgemeine Fragen
Thema: convert frage von c nach python
Antworten: 16
Zugriffe: 3655

hmm irgendwie raff ich das nicht ganz mit python


import socket
uds = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM)
uds.connect(("/tmp/q_socket"))
buf = [0,0,0,0,0,0,0]
buf[0] = hex((0x0001 >> 8)& 0xff)
buf[1] = hex((0x0001 >> 0)& 0xff)
buf[2] = hex((0x03 >> 8)& 0xff)
buf[3] = hex((0x03 >> 0 ...
von _blubber_
Montag 3. August 2009, 19:22
Forum: Allgemeine Fragen
Thema: convert frage von c nach python
Antworten: 16
Zugriffe: 3655

convert frage von c nach python

wie kann ich folgendes in python abbilden

unsigned int tag;
unsigned char buf[3];

assert(tag == 0x23);

buf[0] = 0x04;
buf[1] = 0x13;
buf[2] = 0x08;
buf[3] = 0x00;

buf[0] = (tmp >> 4) & 0xff;
buf[1] = (tmp >> 0) & 0xff;
buf[2] = (len >> 4) & 0xff;
buf[3] = (len >> 0) & 0xff;


das ganze ist für ...