ASPN ActiveState Programmer Network
ActiveState
/ Home / Perl / PHP / Python / Tcl / XSLT /
/ Safari / My ASPN /
Cookbooks | Documentation | Mailing Lists | Modules | News Feeds | Products | User Groups


Recent Messages
List Archives
About the List
List Leaders
Subscription Options

View Subscriptions
Help

View by Topic
ActiveState
.NET Framework
Open Source
Perl
PHP
Python
Tcl
Web Services
XML & XSLT

View by Category
Database
General
SOAP
System Administration
Tools
User Interfaces
Web Programming
XML Programming


MyASPN >> Mail Archive >> wxPython-users
wxPython-users
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

Privacy Policy | Email Opt-out | Feedback | Syndication
© ActiveState Software Inc. All rights reserved