[Tutor] Threads, ok to access parent script methods by passing 'self' ?

2012-06-05 Thread dave selby
Hi All, If a thread is started and 'self' is passed as a parameter, is it acceptable to access methods of the calling class via 'self.updateGrid()' etc from within the thread or does everything have to be done via wx.lib.pubsub and publisher calls ? Cheers Dave -- Please avoid sending

Re: [Tutor] Threads, ok to access parent script methods by passing 'self' ?

2012-06-05 Thread Walter Prins
Hi Dave, On 5 June 2012 11:13, dave selby dave6...@gmail.com wrote: Hi All, If a thread is started and 'self' is passed as a parameter, is it acceptable to access methods of the calling class via 'self.updateGrid()' etc from within the thread or does everything have to be done via

Re: [Tutor] Threads, ok to access parent script methods by passing 'self' ?

2012-06-05 Thread dave selby
On 5 June 2012 12:05, dave selby dave6...@gmail.com wrote: I was running the thread by instantiating a separate class but this will make the very neat CallAfter() difficult, is it OK to call a method in the main class as a thread in which case the CallAfter() should work OK ? Thanks Again

[Tutor] error_connection_refused

2012-06-05 Thread BILAL Mustapha
Hello, I am trying to lunch a small python program but I am always getting this error: s.connect((IP, PORT)) File /usr/lib/python2.7/socket.py, line 224, in meth return getattr(self._sock,name)(*args) socket.error: [Errno 111] Connection refused What's weird that it doesn't even print

[Tutor] Newbe problem with wxPython on Mac OS X (need a work-around)

2012-06-05 Thread William R. Wing (Bill Wing)
I'm running Mac OS-X 10.7.4 (Lion) and have installed Python 2.7 from Python.org. It's in /Library so as to not conflict with the one from Apple in /System/Library and I've set my .profile to make it my default. So far so good. I decided I wanted to start playing with wxPython, and downloaded

Re: [Tutor] Newbe problem with wxPython on Mac OS X (need a work-around)

2012-06-05 Thread Alan Gauld
On 05/06/12 20:00, William R. Wing (Bill Wing) wrote: I assumed this was due to an architecture conflict (32 vs 64 bits), so grabbed the 2.9 version of wxPython which is based on cocoa I get exactly the same error, so the problem really is with the ScriptingAdditions. I suggest you'll get

Re: [Tutor] error_connection_refused

2012-06-05 Thread Alan Gauld
On 05/06/12 12:53, BILAL Mustapha wrote: Hello, Hi, Its best not to hijack somebody else's thread coz it messes up all the threaded mail/news readers out there. (At least you changed the subject though!). Please start with a fresh mail for a new topic. I am trying to lunch a small python

Re: [Tutor] error_connection_refused

2012-06-05 Thread Steven D'Aprano
BILAL Mustapha wrote: Here is the code: Unfortunately not. What you have posted contains at least two SyntaxErrors that prevents it from running: def send_data(): *print(test sending data)* s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) *s.connect((IP, PORT))* Two of those

[Tutor] The dreaded UnicodeDecodeError... why, why, why does it still want ascii?

2012-06-05 Thread Marc Tompkins
Hello all - it's been a while! I'm trying to parse a webpage using lxml; every time I try, I'm rewarded with UnicodeDecodeError: 'ascii' codec can't decode byte 0x?? in position?: ordinal not in range(128)  (the byte value and the position occasionally change; the error never does.) The

[Tutor] Running .py Files

2012-06-05 Thread Benjamin Cox
Hello, So, I'm very new to Python and programming in general, and I've been having trouble figuring out how to run programs by clicking on their .py file name. For some reason, my computer's default setting is to open them in wordpad. I have Windows 7 32-bit OS and Python 3.2.3. Any help would

Re: [Tutor] Running .py Files

2012-06-05 Thread Mark Lawrence
On 06/06/2012 04:14, Benjamin Cox wrote: Hello, So, I'm very new to Python and programming in general, and I've been having trouble figuring out how to run programs by clicking on their .py file name. For some reason, my computer's default setting is to open them in wordpad. I have Windows 7