Re: [Tutor] Maximum recursion depth problem.

2010-08-03 Thread Wesley Brooks
Morning Peter, Thanks, that was something I was unaware of! Not sure how I hadn't bumped into that before! Cheers, Wesley. On 3 August 2010 11:40, Peter Otten <__pete...@web.de> wrote: > Wesley Brooks wrote: > >> I'm having real difficulty understanding why the fol

Re: [Tutor] Maximum recursion depth problem.

2010-08-03 Thread Wesley Brooks
;: a = A() d_list_1 = a.break_down(34567, 256) print d_list_1 a2 = A() d_list_2 = a2.break_down(34567, 256) print d_list_2 Yours Faithfully, Wesley Brooks On 3 August 2010 11:02, Wesley Brooks wrote: > Dear Python Users, > > I'm having real difficulty understanding why t

[Tutor] Maximum recursion depth problem.

2010-08-03 Thread Wesley Brooks
t_list_1 a2 = A() digit_list_2 = a2.break_down(34567, 256) print digit_list_2 I'm a little stumped as I don't think I'm using any global or class variables? Any help would be much appreciated. Yours Faithfully, Wesley Brooks ___ T

Re: [Tutor] ask-why I cannot run it, and I am so confused about the traceback

2010-04-07 Thread Wesley Brooks
Morning, Your only supplying one argument to cone, when you need two: radius & height. Cheers, Wesley Brooks. On 7 April 2010 11:56, Shurui Liu (Aaron Liu) wrote: > # Filename: classVolume.py > # Demonstrates multiple classes per program. > > class Cube: >    "&

Re: [Tutor] Small python web server suitable for web cam streams?

2009-01-14 Thread Wesley Brooks
your help. I'll have a look at CherryPy. Wesley. 2009/1/14 Kent Johnson > On Wed, Jan 14, 2009 at 10:37 AM, Wesley Brooks > wrote: > > I have a machine which runs for extended periods of time, and often into > > days rather than just hours. I would like to set up the com

[Tutor] Small python web server suitable for web cam streams?

2009-01-14 Thread Wesley Brooks
es on the local network. There is currently no requirement for any control from the user end, just to view the page or pages. This will be running on a windows machine. Yours Faithfully, Wesley Brooks ___ Tutor maillist - Tutor@python.org

[Tutor] Is it thread safe to collect data from threads where run has finished?

2008-11-01 Thread Wesley Brooks
this or should I just attach the dataObject to the event? Is the use of wx.PostEvent thread safe? Thanks in advance of any advice, Wesley Brooks ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Which exceptions should I be catching?

2008-10-20 Thread Wesley Brooks
ing caught by the exception into a log and go more specific at a later date. Cheers, Wesley Brooks > On Mon, Oct 20, 2008 at 3:30 PM, Wesley Brooks <[EMAIL PROTECTED]>wrote: > >> Unfortunately due to the nature of the program the error has normally >> happened hours ago a

[Tutor] Which exceptions should I be catching?

2008-10-20 Thread Wesley Brooks
reasons. Thanks in advance of any suggestions, Wesley Brooks. ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Creating a unicode string from bytes and % opperator

2008-07-28 Thread Wesley Brooks
Thanks Tim Golden, That'll do the trick! Thought there must have been something simple for it! Cheers, Wesley Brooks 2008/7/28 Tim Golden <[EMAIL PROTECTED]>: > Wesley Brooks wrote: >> >> I'm trying to create a unicode character from two bytes. Unfortunatly >&

[Tutor] Creating a unicode string from bytes and % opperator

2008-07-28 Thread Wesley Brooks
e information. >>> a = u"\u%s%s" %('0d', 'fe') UnicodeDecodeError: 'unicodeescape' codec can't decode bytes in position 0-2: tr uncated \u escape >>> Cheers, Wesley Brooks. ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Make sound with python? Cross platform?

2008-03-09 Thread Wesley Brooks
Thanks very much. Not quite sure why I didn't find those earlier! I'll have a look now. Cheers, Wesley. On 09/03/2008, Kent Johnson <[EMAIL PROTECTED]> wrote: > Wesley Brooks wrote: > > Dear Users, > > > > I've been digging around to try and find a w

[Tutor] Make sound with python? Cross platform?

2008-03-09 Thread Wesley Brooks
would prefer a solution that is cross platform, and standard library but would settle for Linux only solutions that can be downloaded - which preferably don't need compiling. Thanks for any suggestions. Yours Faithfully, Wesley Brooks ___ Tutor maillist

[Tutor] Closing file objects when object is garbage collected?

2008-02-12 Thread Wesley Brooks
user interface either completely disappears, or gives a OS error message unhanded exception error. Thanks in advance of any help, Wesley Brooks. ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Interactive Menu Woes

2007-11-14 Thread Wesley Brooks
In the middle of your addName function you have defined another function that requires 'self' and you've got a default argument 'get=1'; def numberType(self, get = 1): You call this further down the function with the line; self.type = numberType(self.get) This should have been; self.type = num

Re: [Tutor] __doc__ strings for attributes?

2007-11-09 Thread Wesley Brooks
ction I could run; >>> print ' '.strip.__doc__ S.strip([chars]) -> string or unicode Return a copy of the string S with leading and trailing whitespace removed. If chars is given and not None, remove characters in chars instead. If chars is unicode, S will be converted to unic

[Tutor] __doc__ strings for attributes?

2007-11-09 Thread Wesley Brooks
s as they're taking up vast chunks of my code at the moment and do very little! Can I also stop new attributes being added to the MakeBasicShape class? Thanks in advance of any help. Wesley Brooks ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] visualizing code structure / flow charting

2007-11-06 Thread Wesley Brooks
Following on from the comments above two things I've found really helpful are the __doc__ strings and the exec command. for example: >>> a = 'a random string' >>> dir(a) ['__add__', '__class__', '__contains__', '__delattr__', '__doc__', '__eq__', '__ge__', '__getattribute__', '__getitem__', '__ge

[Tutor] Atomic file creation?

2007-09-28 Thread Wesley Brooks
Linux and windows, this leaves my code more robust and interestingly sometimes the Linux interpreter picks up different errors than the windows interpreter and visa versa. 2. It doesn't look very nice! I'm assuming there must be something in python

Re: [Tutor] question about *args and functions

2007-01-26 Thread Wesley Brooks
Greetings, You could default it to None and check in your script to see if it has changed. def some_function(req_var, req_var2, un_req_var=None): if un_req_var != None: dosomething else: dosomethingelse Wesley Brooks. On 26/01/07, shawn bright <[EMAIL PROTECTED]> wrote

Re: [Tutor] Inheriting Classes and __init__

2007-01-26 Thread Wesley Brooks
Thanks again, that is a great help. Wesley Brooks On 26/01/07, Kent Johnson <[EMAIL PROTECTED]> wrote: > Wesley Brooks wrote: > > Dear Users, > > > > I would like a class to inherit the methods from wxVTKRenderWindow, > > but to add a few lines of code to

[Tutor] Inheriting Classes and __init__

2007-01-26 Thread Wesley Brooks
the inheriting class it would overide the init in the inherited class? Yours faithfully, Wesley Brooks ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Global values & import scope

2007-01-24 Thread Wesley Brooks
() assemblyItem3 >>>a.PrintID() assemblyItem4 >>>b.PrintID() assemblyItem5 Thanks again for your help. Wesley Brooks. On 24/01/07, Kent Johnson <[EMAIL PROTECTED]> wrote: > Wesley Brooks wrote: > > Dear Users, > > > > I'm using global values to creat

[Tutor] Global values & import scope

2007-01-24 Thread Wesley Brooks
name, or would they only be unique within the scope of the file which contains the import of the bellow class? itemID = 0 class AssemblyItem: def __init__(self): global itemID self.ID = "assemblyItem" + str(itemID) itemID += 1 Thanks for any help, Yours Fait

Re: [Tutor] Finding the key for a value in a dictionary.

2007-01-11 Thread Wesley Brooks
if I had used a list I would have to update all references to an object if an object before it in the list was deleted as it's index would change. Wesley. On 11/01/07, Kent Johnson <[EMAIL PROTECTED]> wrote: > Wesley Brooks wrote: > > Dear Users, > > > > I'

[Tutor] Finding the key for a value in a dictionary.

2007-01-11 Thread Wesley Brooks
Dear Users, I'm trying to find the key of a unique value within a dictionary. Is the code bellow a safe way of doing so, or is there a better way of doing it? a = {'de':'df', 'gf':'hg'} key = a.keys()[a.values().index('hg')]

Re: [Tutor] User identification and running in the background.

2006-12-13 Thread Wesley Brooks
ivial issue to either supply information on what user the attempt is coming from within the initial communication, or for the low level program to identify where/who the request is coming from? Thanks, Wesley Brooks. On 13/12/06, Tor Hildrum <[EMAIL PROTECTED]> wrote: > On 12/12/06, Tim

Re: [Tutor] User identification and running in the background.

2006-12-13 Thread Wesley Brooks
ced a version on Linux for evaluation purposes. Thanks again, I'll look up the SID and Token you mentioned. Wesley Brooks On 12/12/06, Tim Golden <[EMAIL PROTECTED]> wrote: > | I've had a quick scan around and can't find a way to identify the user > | who is logged in on the m

[Tutor] User identification and running in the background.

2006-12-12 Thread Wesley Brooks
l of the system again. When I link this to the user identification I would be able to vary the access to the machine depending on the access rights of the user. Thank you in advance of any help. Wesley Brooks. ___ Tutor maillist - Tutor@

[Tutor] Efficient programming questions. Tuples vs Lists; Custom Objects vs Lists.

2006-09-25 Thread Wesley Brooks
carrying out a complete compile would gain minimal increases in performance? Thank you for your time and help.Yours Faithfully,Wesley Brooks ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor