473,322 Members | 1,614 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

Reading external files or internal data

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
Jul 18 '05 #1
0 1510

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Christopher Benson-Manica | last post by:
Just FMI, if an external stylesheet is linked to a page (with <link>), will subsequent <style> tags override the values in the external stylesheet? -- Christopher Benson-Manica | I *should*...
4
by: Peter Ammon | last post by:
I would like to share a variable between two functions defined in two separate source files; no other functions will need the global variable so I'd prefer to not give it file scope. Thus, I want...
5
by: rnorthedge | last post by:
I am working on a code library which needs to read in the data from large binary files. The files hold int, double and string data. This is the code for reading in the strings: protected...
3
by: eieiohh | last post by:
MySQL 3.23.49 PHP 4.3.8 Apache 2.0.51 Hi All! Newbie.. I had a CRM Open Source application installed and running. Windows Xp crashed. I was able to copy the contents of the entire hard...
28
by: Andrew Poulos | last post by:
When loading an rss feed into Windows IE, doc.childNodes.length always equals 0. If I manually delete the <!DOCTYPE tag doc.childNodes.length is correct. I'm using doc = new...
4
by: Ê÷Éϲä»Ò | last post by:
'rar' is not recognized as an internal or external command, operable program or batch file. import os import time source = target_dir = r'e:\temp\bak' target =...
1
by: Daniel Di Vita | last post by:
I have an application that needs to pull files from an internal server. This is the setup. The web server is external facing, meaning exposed to the internet. I then have a file server that sits...
2
by: Gnus | last post by:
Hi all! I have a little(?) problem with external schema location... I'm using xerces/xalan (C++) for doing some actions with some set of xml-files. Some of these files must validating...
13
by: swetha | last post by:
HI Every1, I have a problem in reading a binary file. Actually i want a C program which reads in the data from a file which is in binary format and i want to update values in it. The file...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.