Re: [wxPython-users] Problem in opening a file from open dialog
by Ambika other posts by this author
Dec 11 2004 7:23PM messages near this date
Re: [wxPython-users] Basics of drawing on a wx.Panel
|
[wxPython-users] [Q] Feature Changes???
Hey Eric,
Thanks...I tired print "#', f.read(), "#"..it does work but the file
is getting printed in the python GUI itself (I didnt know how to run
it from python command line). So how do I make the file open in a
separate editor??
Thanks once again..
ambika
On Fri, 10 Dec 2004 16:28:54 +0100, Eric Nieuwland
<eric.nieuwland@[...].nl> wrote:
> Hi Ambika,
>
> See what happens if you make the following modification and start the
> script from the commandline.
>
>
>
> On 10 dec 2004, at 15:14, Ambika wrote:
> > def OnOpenClick(self, evt):
> > dlg = wx.FileDialog(self, message="Choose a file", defaultDir="",
> > defaultFile="",wildcard=wildcard,
> > style=wx.OPEN|wx.MULTIPLE|wx.CHANGE_DIR)
> > if dlg.ShowModal() == wx.ID_OK:
> > filename = dlg.GetFilename()
> > dirname = dlg.GetDirectory()
> > f = file(os.path.join(dirname, filename), 'r')
> print "#', f.read(), "#"
> > #self.control.SetValue(f.read())
> > f.close()
> > dlg.Destroy()
>
> BTW The error message means 'self.control' does not exist, so you can't
> call it's SetValue method.
>
> --eric
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: wxPython-users-unsubscribe@[...].org
For additional commands, e-mail: wxPython-users-help@lists.wxwidgets.org
|