seek in a file

Andreas Penzel mail at andreas-penzel.de
Wed Mar 27 04:52:23 EST 2002


"Steven Majewski" wrote:

> Are the files too big to fit in memory ?

the file is about 1 MB, i have to test out working

> What do you want to do with the lines ?
> ( I hope you weren't planning on trying to modify a line in a file:
>   because of the variable length on lines, if you don't write
>   exactly the same number of chars back, you will either overwite
>   the next line, or leave an extra partial line after your edited
>   line. Most text editors read the whole file into memory and then
>   write out a new file after it's modified in memory. )

In the file are barcodes of products, one per line.
The program has to look if the scanned code from the barcode-scanner is
identically with one in the file included. This is important because the
barcode-scanner sometimes works not correct. All i need is an search-routine
that compares the scanned code with the codes in the file. If there is an
code, the programs waits for the next code.







More information about the Python-list mailing list