D
DeveloperX
I am trying to figure out how to rewrite the following chunk of code
in Python:
C source
My first idea was to create a class for PF and a class for BLOCK, but
I got lost somewhere along the lines. :\
Python Attempt: Please note that since I can't type TABs online
easily, I am using the @ character to represent TABs in the following
Python code.
Any Python Gurus out there that can help me?
in Python:
C source
Code:
typedef struct PF
{
int flags;
long user;
char*filename;
unsigned char buffer[MAXBUFFERSIZE];
} PF;
typedef BLOCK
{
PF * packdata;
} BLOCK;
BLOCK* blocks;
My first idea was to create a class for PF and a class for BLOCK, but
I got lost somewhere along the lines. :\
Python Attempt: Please note that since I can't type TABs online
easily, I am using the @ character to represent TABs in the following
Python code.
Code:
class PF:
@def __init__(self):
@@self.flags, self.user = 0, 0
@@self.filename = ''
@@self.buffer = []
class BLOCK:
@def __init__(self):
@@self.packdata = []
blocks = []
Any Python Gurus out there that can help me?