Reading external files or internal data

  • Thread starter Hans-Joachim Widmaier
  • Start date
H

Hans-Joachim Widmaier

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
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,581
Members
45,056
Latest member
GlycogenSupporthealth

Latest Threads

Top