>
> You should really switch to the "with open() as f:" idiom I keep showing
> you. This will automatically close the file for you.
>
it just occured to me to do this:
def openFile(self, evt):
with wx.FileDialog(self, "Choose a file", os.getcwd(), "",
"*.txt*", wx.OPEN) as dlg:
if dlg.ShowModal() == wx.ID_OK:
path = dlg.GetPath()
mypath = os.path.basename(path)
with open(mypath, "a") as f:
f.writelines(self.log_array)
so thats how i used what you said, "with open() as f:". is this the
right way to open the file?
_______________________________________________
Tutor maillist - [email protected]
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor