Editing File
D
duncanm255 at hotmail.com
Wed Jul 12 11:00:04 EDT 2006
Thanks, guys. So overall, would it just be easier (and not too rigged)
if any changes were made by just editing the text file? I want to do
this project the right way, but if it's going to be a big pain to
implement the edit function, just modifying the text file directly
isn't that big of a deal..
akameswaran at gmail.com wrote:
> D wrote:
> > Hi, I currently have a Python app with a Tkinter GUI frontend that I
> > use for system administration. Everytime it launches, it reads a text
> > file which contains info about each host I wish to monitor - each field
> > (such as IP, hostname, etc.) is delimited by !!. Now, I want to be
> > able to edit host information from within the GUI - what would be the
> > best way to go about this? Basically I just need to either edit the
> > original host line, or write a new host line and delete the
> > original..thanks!
>
> Might be overkill - but pickle the data memeber that contains the
> information. If you use text instead of binary pickling it should
> still be editable by hand. for a single line of text it may be a bit
> much - but it's still probably quicker than opening a file, parsing
> etc.
More information about the Python-list
mailing list