osdir.com


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


Hi

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

https://raw.githubusercontent.com/zleap/AboutMe/master/Aboutme.py

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

https://stackoverflow.com/questions/3277503/how-to-read-a-file-line-by-line-into-a-list


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.

Thanks

Paul