Re: [Tutor] Need Help Modifying a wxPython GUI (scrolling display and logging)

2013-06-19 Thread Matt D
> A common way to trigger UI actions is a button whose callback calls that. > Or you can bind in an event hook for closing the window. > > in __init__ add this line - > self.Bind(wx.EVT_CLOSE, self.onExit) > > > def onExit(self, event): >'''Run when closing''' >self.logfile.close() >

Re: [Tutor] Need Help Modifying a wxPython GUI (scrolling display and logging)

2013-06-19 Thread Prasad, Ramit
Matt D wrote: > > > > > > Also note, that unless you do self.logfile.close() it is not guaranteed > > that the data is being written to file. I prefer to use the following > > idiom for Python 2.6+ (might be in 2.5, but not sure offhand when it was > > added). > > > > with open('filename.txt', 'a'

Re: [Tutor] Need Help Modifying a wxPython GUI (scrolling display and logging)

2013-06-18 Thread Matt D
> Everything Dave Angel said applies. > > You can sort the keys by doing and sorting the keys and then logging. > That should ensure field order. > > for k in sorted(self.fields): > v = self.fields[k] > > > Also note, that unless you do self.logfile.close() it is not guaranteed > that the d

Re: [Tutor] Need Help Modifying a wxPython GUI (scrolling display and logging)

2013-06-18 Thread Prasad, Ramit
Matt D wrote: > > There are other ways a script might change the current directory. For > > example, some naive scripts use os.chdir() > > > > But how is it you don't know what the current directory was when the > > code ran? A simply pwd can tell you, if your prompt doesn't already > > reveal i

Re: [Tutor] Need Help Modifying a wxPython GUI (scrolling display and logging)

2013-06-13 Thread Matt D
On 06/13/2013 03:39 AM, Alan Gauld wrote: > On 13/06/13 05:24, Matt D wrote: > >> I already told you i found the file? why would someone else be running >> the program? > > Because it does something useful? > Most pro programmers write programs for other people to use. > Even an amateur may be c

Re: [Tutor] Need Help Modifying a wxPython GUI (scrolling display and logging)

2013-06-13 Thread Alan Gauld
On 13/06/13 05:24, Matt D wrote: I already told you i found the file? why would someone else be running the program? Because it does something useful? Most pro programmers write programs for other people to use. Even an amateur may be creating something for their family use. If someone other

Re: [Tutor] Need Help Modifying a wxPython GUI (scrolling display and logging)

2013-06-12 Thread Matt D
On 06/12/2013 09:54 PM, Dave Angel wrote: > On 06/12/2013 09:14 PM, Matt D wrote: >> On 06/12/2013 09:02 PM, Dave Angel wrote: >>> On 06/12/2013 08:46 PM, Matt D wrote: On 06/12/2013 05:59 PM, Dave Angel wrote: > On 06/12/2013 05:32 PM, Matt D wrote: >>> >>> >>> >> Hey, >> if

Re: [Tutor] Need Help Modifying a wxPython GUI (scrolling display and logging)

2013-06-12 Thread Dave Angel
On 06/12/2013 09:23 PM, Matt D wrote: There are other ways a script might change the current directory. For example, some naive scripts use os.chdir() But how is it you don't know what the current directory was when the code ran? A simply pwd can tell you, if your prompt doesn't already rev

Re: [Tutor] Need Help Modifying a wxPython GUI (scrolling display and logging)

2013-06-12 Thread Matt D
> There are other ways a script might change the current directory. For > example, some naive scripts use os.chdir() > > But how is it you don't know what the current directory was when the > code ran? A simply pwd can tell you, if your prompt doesn't already > reveal it. > > hey i found the

Re: [Tutor] Need Help Modifying a wxPython GUI (scrolling display and logging)

2013-06-12 Thread Dave Angel
On 06/12/2013 08:46 PM, Matt D wrote: On 06/12/2013 05:59 PM, Dave Angel wrote: On 06/12/2013 05:32 PM, Matt D wrote: Hey, if i put: self.logfile = open('logfile.csv', 'w') in the .py file, within the 'class TrafficPane', then shouldn't logfile.csv be written to the directory the .

Re: [Tutor] Need Help Modifying a wxPython GUI (scrolling display and logging)

2013-06-12 Thread Matt D
On 06/12/2013 05:59 PM, Dave Angel wrote: > On 06/12/2013 05:32 PM, Matt D wrote: >> On 06/10/2013 12:23 PM, Prasad, Ramit wrote: >>> Matt D wrote: Ramit Prasad wrote: >>> Scrolled panel is just a graphical container that allows for >>> scrolling inside, >>> but it is the window th

Re: [Tutor] Need Help Modifying a wxPython GUI (scrolling display and logging)

2013-06-12 Thread Dave Angel
On 06/12/2013 05:32 PM, Matt D wrote: On 06/10/2013 12:23 PM, Prasad, Ramit wrote: Matt D wrote: Ramit Prasad wrote: Scrolled panel is just a graphical container that allows for scrolling inside, but it is the window that scrolls not widgets inside it. This of it like a webpage that scrolls. I

Re: [Tutor] Need Help Modifying a wxPython GUI (scrolling display and logging)

2013-06-12 Thread Matt D
On 06/10/2013 12:23 PM, Prasad, Ramit wrote: > Matt D wrote: >> Ramit Prasad wrote: > Scrolled panel is just a graphical container that allows for scrolling > inside, > but it is the window that scrolls not widgets inside it. This of it like > a webpage that scrolls. If you use we

Re: [Tutor] Need Help Modifying a wxPython GUI (scrolling display and logging)

2013-06-04 Thread Prasad, Ramit
Matt D wrote: > Hello, > > I am using an open source wxPython GUI that I like very very much. I > have ideas about some modifications I need but I cannot be bothering the > author too much so I must learn some very specific things about Python > in order to make the modification myself. First, I

Re: [Tutor] Need Help Modifying a wxPython GUI (scrolling display and logging)

2013-06-03 Thread Alan Gauld
On 03/06/13 15:01, Matt D wrote: I am using an open source wxPython GUI that I like very very much. I have ideas about some modifications I need but I cannot be bothering the author too much so I must learn some very specific things about Python OK, we can help on the python bits but not so mu

[Tutor] Need Help Modifying a wxPython GUI (scrolling display and logging)

2013-06-03 Thread Matt D
Hello, I am using an open source wxPython GUI that I like very very much. I have ideas about some modifications I need but I cannot be bothering the author too much so I must learn some very specific things about Python in order to make the modification myself. First, I need some help understandi