Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #44444

Re: File Read issue by using module binascii

Path csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.freenet.ag!news2.euro.net!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail
Return-Path <python-python-list@m.gmane.org>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.000
X-Spam-Evidence '*H*': 1.00; '*S*': 0.00; 'f.close()': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'subject:module': 0.09; 'subject:using': 0.09; 'python': 0.11; 'def': 0.12; 'advance!': 0.16; 'hex': 0.16; 'received:80.91.229.3': 0.16; 'received:dip0.t-ipconnect.de': 0.16; 'received:plane.gmane.org': 0.16; 'received:t-ipconnect.de': 0.16; 'subject:File': 0.16; 'subject:issue': 0.16; 'wrote:': 0.18; 'import': 0.22; 'shell': 0.22; 'this?': 0.23; 'header:User- Agent:1': 0.23; 'header:X-Complaints-To:1': 0.27; 'skip:( 20': 0.30; 'code': 0.31; 'run': 0.32; 'skip:# 10': 0.33; 'skip:o 20': 0.38; 'thank': 0.38; 'to:addr:python-list': 0.38; 'to:addr:python.org': 0.39; 'received:org': 0.40; 'tell': 0.60; 'become': 0.64
X-Injected-Via-Gmane http://gmane.org/
To python-list@python.org
From Peter Otten <__peter__@web.de>
Subject Re: File Read issue by using module binascii
Date Sat, 27 Apr 2013 12:57:09 +0200
Organization None
References <9b5795ab-baec-4c0a-a3b4-1075cffc8744@googlegroups.com>
Mime-Version 1.0
Content-Type text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding 7Bit
X-Gmane-NNTP-Posting-Host p508489b0.dip0.t-ipconnect.de
User-Agent KNode/4.7.3
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.15
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <http://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list/>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <http://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.1122.1367060234.3114.python-list@python.org> (permalink)
Lines 21
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1367060234 news.xs4all.nl 15891 [2001:888:2000:d::a6]:57701
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:44444

Show key headers only | View raw


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():
>     f = open('example.bmp','rb')
>     rawdata = f.read()                       #f.read(1000) is ok
>     hexstr = binascii.b2a_hex(rawdata)       #Get an HEX number
>     bsstr = bin (int(hexstr,16))[2:]
>     f.close()
>     print('bin: ',bsstr,type(bsstr))
>     return

What shell are you using? The one provided by Idle?

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

File Read issue by using module binascii Jimmie He <jimmie.he@gmail.com> - 2013-04-26 20:57 -0700
  Re: File Read issue by using module binascii Jimmie He <jimmie.he@gmail.com> - 2013-04-26 21:22 -0700
    Re: File Read issue by using module binascii Fábio Santos <fabiosantosart@gmail.com> - 2013-04-27 10:56 +0100
      Re: File Read issue by using module binascii Jimmie He <jimmie.he@gmail.com> - 2013-04-27 03:42 -0700
  Re: File Read issue by using module binascii Peter Otten <__peter__@web.de> - 2013-04-27 12:57 +0200
    Re: File Read issue by using module binascii Jimmie He <jimmie.he@gmail.com> - 2013-04-27 04:23 -0700
      Re: File Read issue by using module binascii Fábio Santos <fabiosantosart@gmail.com> - 2013-04-27 12:40 +0100
      Re: File Read issue by using module binascii Peter Otten <__peter__@web.de> - 2013-04-27 14:01 +0200
  Re: File Read issue by using module binascii Jimmie He <jimmie.he@gmail.com> - 2013-04-27 05:46 -0700
  Re: File Read issue by using module binascii Tim Roberts <timr@probo.com> - 2013-04-27 21:34 -0700
    Re: File Read issue by using module binascii Peter Otten <__peter__@web.de> - 2013-04-28 09:42 +0200
    Re: File Read issue by using module binascii jt@toerring.de (Jens Thoms Toerring) - 2013-04-28 12:04 +0000
      Re: File Read issue by using module binascii Jimmie He <jimmie.he@gmail.com> - 2013-04-28 06:32 -0700

csiph-web