Re: File Read issue by using module binascii

2013-04-28 Thread Jimmie He
On Sunday, April 28, 2013 8:04:04 PM UTC+8, Jens Thoms Toerring wrote: > Tim Roberts wrote: > > > Jimmie He wrote: > > > > > >When I run the readbmp on an example.bmp(about 100k),the Shell is become > > >to "No respose",when I change f.read() to f.read(1000),it is ok,could > > >someone tell

Re: File Read issue by using module binascii

2013-04-28 Thread Jens Thoms Toerring
Tim Roberts wrote: > Jimmie He wrote: > >When I run the readbmp on an example.bmp(about 100k),the Shell is become to > >"No respose",when I change f.read() to f.read(1000),it is ok,could someone > >tell me the excat reason for this? > >Thank you in advance! > > > >Python Code as below!! > > >

Re: File Read issue by using module binascii

2013-04-28 Thread Peter Otten
Tim Roberts wrote: > Jimmie He wrote: > >>When I run the readbmp on an example.bmp(about 100k),the Shell is become >>to "No respose",when I change f.read() to f.read(1000),it is ok,could >>someone tell me the excat reason for this? Thank you in advance! >> >>Python Code as below!! >> >>import bi

Re: File Read issue by using module binascii

2013-04-27 Thread Tim Roberts
Jimmie He wrote: >When I run the readbmp on an example.bmp(about 100k),the Shell is become to >"No respose",when I change f.read() to f.read(1000),it is ok,could someone >tell me the excat reason for this? >Thank you in advance! > >Python Code as below!! > >import binascii > >def read_bmp(): >

Re: File Read issue by using module binascii

2013-04-27 Thread Jimmie He
Peter, Thanks for your test in details. Because I'm an newbie in Python and I can not conform whether it is an bug. Here I attach my code include my emample.bmp as link below. https://hotfile.com/dl/204795514/62fed41/BMPTool.zip.html -- http://mail.python.org/mailman/listinfo/python-list

Re: File Read issue by using module binascii

2013-04-27 Thread Peter Otten
Jimmie He wrote: >> What shell are you using? The one provided by Idle? > > Yes. I use IDLE,the python version is 3.3.1.What else could I use?? The shell provided by the operating system is usually much faster. When I modify your code to import binascii def read_bmp(): f = open('example.b

Re: File Read issue by using module binascii

2013-04-27 Thread Fábio Santos
You could use your operating system's shell. Even if it is windows, it should be a lot better and faster, and thus not block so easily. On 27 Apr 2013 12:28, "Jimmie He" wrote: > > > What shell are you using? The one provided by Idle? > > Yes. I use IDLE,the python version is 3.3.1.What else coul

Re: File Read issue by using module binascii

2013-04-27 Thread Jimmie He
> What shell are you using? The one provided by Idle? Yes. I use IDLE,the python version is 3.3.1.What else could I use?? -- http://mail.python.org/mailman/listinfo/python-list

Re: File Read issue by using module binascii

2013-04-27 Thread Peter Otten
Jimmie He wrote: > When I run the readbmp on an example.bmp(about 100k),the Shell is become > to "No respose",when I change f.read() to f.read(1000),it is ok,could > someone tell me the excat reason for this? Thank you in advance! > > Python Code as below!! > > import binascii > > def read_bmp(

Re: File Read issue by using module binascii

2013-04-27 Thread Jimmie He
What you said should make sense and I've already correct my code by your advice,thanks for your response! 在 2013年4月27日星期六UTC+8下午5时56分08秒,Fábio Santos写道: > It may be that you are printing too much data at once. 100k is a bit too much > to have in memory but it should run anyway. But your console

Re: File Read issue by using module binascii

2013-04-27 Thread Fábio Santos
It may be that you are printing too much data at once. 100k is a bit too much to have in memory but it should run anyway. But your console may be having trouble. Try looping over small chunks of the file and printing them one at a time. Use a while loop. I do know that in windows the console is not

Re: File Read issue by using module binascii

2013-04-26 Thread Jimmie He
when I commet the line of "print('bin: ',bsstr,type(bsstr)) ",it can be run,so maybe the problem is the memory allocate of so long strings..Am I right? 在 2013年4月27日星期六UTC+8上午11时57分45秒,Jimmie He写道: > When I run the readbmp on an example.bmp(about 100k),the Shell is become to > "No respose",wh

File Read issue by using module binascii

2013-04-26 Thread Jimmie He
When I run the readbmp on an example.bmp(about 100k),the Shell is become to "No respose",when I change f.read() to f.read(1000),it is ok,could someone tell me the excat reason for this? Thank you in advance! Python Code as below!! import binascii def read_bmp(): f = open('example.bmp','rb'