Re: what is wrong in my code?? (python 3.3)

2013-09-30 Thread dream4soul
On Friday, September 27, 2013 7:19:45 PM UTC+3, Denis McMahon wrote: > On Fri, 27 Sep 2013 06:54:48 -0700, dream4soul wrote: > > > > > #!c:/Python33/python.exe -u > > > import os, sys > > > print("Content-type: text/html; charset=utf-8\n\n") >

crc algorithm

2014-09-02 Thread dream4soul
Dear all, I have trouble to implement crc algorithm in python 3.3 c version work perfect. I try to use bytes, int and c_types without any success can some who help me: c version: unsigned short calc_crc(const void *p_dat, int l_dat){ unsigned char *dat_ptr; int loopc;

Re: crc algorithm

2014-09-02 Thread dream4soul
On Tuesday, September 2, 2014 9:24:54 PM UTC+3, Peter Otten wrote: > dream4s...@gmail.com wrote: > > > > > I have trouble to implement crc algorithm in python 3.3 > > > > > > c version work perfect. I try to use bytes, int and c_types without any > > > success can some who help me: > > >

Re: crc algorithm

2014-09-02 Thread dream4soul
On Tuesday, September 2, 2014 9:43:52 PM UTC+3, Chris Kaynor wrote: > Also, depending on the use-case, binascii.crc32 might also work fine: > https://docs.python.org/2/library/binascii.html#binascii.crc32 > > > > > import binascii > def calc_crc(data): >     return binascii.crc32(data) > > >

Re: crc algorithm

2014-09-03 Thread dream4soul
On Wednesday, September 3, 2014 10:19:29 AM UTC+3, Peter Otten wrote: > dream4s...@gmail.com wrote: > > > > > On Tuesday, September 2, 2014 9:24:54 PM UTC+3, Peter Otten wrote: > > >> dream4s...@gmail.com wrote: > > >> > > >> > > >> > > >> > I have trouble to implement crc algorithm in p

Re: crc algorithm

2014-09-03 Thread dream4soul
On Wednesday, September 3, 2014 10:19:29 AM UTC+3, Peter Otten wrote: > dream4s...@gmail.com wrote: > > > > > On Tuesday, September 2, 2014 9:24:54 PM UTC+3, Peter Otten wrote: > > >> dream4s...@gmail.com wrote: > > >> > > >> > > >> > > >> > I have trouble to implement crc algorithm in p

Re: crc algorithm

2014-09-03 Thread dream4soul
On Wednesday, September 3, 2014 12:00:10 PM UTC+3, Peter Otten wrote: > dream4s...@gmail.com wrote: > > > > > calc_crc(b'\x00\x00\x34\x35\x38\x35') > > > > > unsigned char a[]={0x30,0x30,0x34,0x35,0x38,0x35}; > > > > The first two bytes differ; you made an error on the input. Dear Peter,

Re: crc algorithm

2014-09-03 Thread dream4soul
On Wednesday, September 3, 2014 12:00:10 PM UTC+3, Peter Otten wrote: > dream4s...@gmail.com wrote: > > > > > calc_crc(b'\x00\x00\x34\x35\x38\x35') > > > > > unsigned char a[]={0x30,0x30,0x34,0x35,0x38,0x35}; > > > > The first two bytes differ; you made an error on the input. Dear Peter,