Trying to read in data for a file to a python application

Paul Sutton zleap at
Tue Feb 26 10:51:38 EST 2019


I have been trying to write a small application that is essentially user
information application.

So far I have managed to write the data generated to a file, what I want
to do now, is read this data back in when the user opens the program.

Trying to use

with open(fname) as f:
    content = f.readlines()
# you may also want to remove whitespace characters like `\n` at the end
of each line
content = [x.strip() for x in content]

Trying to use this as a guide (hence my code is a little different).
But am really stuck

So far the GUI window appears but no widgets. So something is clearly
getting stalled.

To begin with If I can read the text in, and just display in the console
this is a start, I can then see if I can figure out how to take that and
insert the data in to the right places.

Can anyone help please.



More information about the Python-list mailing list