Reading external files or internal data

Discussion in 'Python' started by Hans-Joachim Widmaier, Aug 11, 2003.

  1. Hi,

    I have a class that reads most common files (text, images, tar
    archives, zip archives). I just read in the whole thing and decide
    then what to do with it - create a gtk.TextView, gdk.pixbuf, or
    tables-of-contents, whatever. Looking at the functions in the
    appropriate modules shows that most of them want to read from external
    files. Some take file-like objects, others don't. And tarfile allows
    it for gzip compressed archives, but not for bzip2 compressed ones.
    This is not only horribly inconsistent, it's also ugly. I do not want
    to read an external file over and over again. (If I'd read from
    standard input, I'd have to create a temporary file - yuck!) I want to
    deal just *once* with all the errors that can occur while reading the
    file.

    What am I missing?

    Hans-Joachim Widmaier
     
    Hans-Joachim Widmaier, Aug 11, 2003
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Don Golding
    Replies:
    0
    Views:
    685
    Don Golding
    Apr 23, 2004
  2. =?Utf-8?B?UWluZ2RvbmcgWi4=?=

    Internal or External Reqest

    =?Utf-8?B?UWluZ2RvbmcgWi4=?=, Oct 26, 2004, in forum: ASP .Net
    Replies:
    3
    Views:
    335
    =?Utf-8?B?QmlsbCBCb3Jn?=
    Oct 26, 2004
  3. ABC
    Replies:
    1
    Views:
    820
    Richard Dudley
    Oct 24, 2005
  4. Daniel Di Vita

    External Server pull files from Internal Server

    Daniel Di Vita, Aug 29, 2006, in forum: ASP General
    Replies:
    1
    Views:
    182
    Jeff Cochran
    Aug 30, 2006
  5. Mellow Crow
    Replies:
    6
    Views:
    438
    Richard Cornford
    Nov 4, 2005
Loading...

Share This Page