Re: Deploying on Windows servers : advice sought a module

2011-03-09 Thread Rory Campbell-Lange
another play with py2exe. Many thanks Rory -- Rory Campbell-Lange r...@campbell-lange.net -- http://mail.python.org/mailman/listinfo/python-list

Deploying on Windows servers : advice sought a module

2011-03-08 Thread Rory Campbell-Lange
the hg pull/update process. Windows servers use Tim Golden's WMI modules and the pywin32 extensions. -- Rory Campbell-Lange r...@campbell-lange.net -- http://mail.python.org/mailman/listinfo/python-list

Re: Get name of file from directory into variable

2010-08-03 Thread Rory Campbell-Lange
://docs.python.org/library/glob.html -- Rory Campbell-Lange r...@campbell-lange.net -- http://mail.python.org/mailman/listinfo/python-list

Re: Sort the values of a dict

2009-12-19 Thread Rory Campbell-Lange
Learning Python book but I'm finding that it isn't providing a useful refresher to the language or a particularly good introduction to version 3. Have you any suggestions. Regards Rory -- Rory Campbell-Lange r...@campbell-lange.net Campbell-Lange Workshop www.campbell-lange.net 0207 6311 555 3

Re: Line indexing in Python

2009-12-18 Thread Rory Campbell-Lange
Campbell-Lange Director r...@campbell-lange.net Campbell-Lange Workshop www.campbell-lange.net 0207 6311 555 3 Tottenham Street London W1T 2AF Registered in England No. 04551928 -- http://mail.python.org/mailman/listinfo/python-list

Re: Sort the values of a dict

2009-12-18 Thread Rory Campbell-Lange
, either i[0], i[0][1], i[0][2] or i[0][3]. Rory -- Rory Campbell-Lange Director r...@campbell-lange.net Campbell-Lange Workshop www.campbell-lange.net 0207 6311 555 3 Tottenham Street London W1T 2AF Registered in England No. 04551928 -- http://mail.python.org/mailman/listinfo/python-list

Re: Local class variables? (mod_python problem)

2007-02-23 Thread Rory Campbell-Lange
it's case two. Many thanks for your reply. The use case is per request, and I would be grateful to learn more about thread-local storage. Kind regards Rory -- Rory Campbell-Lange [EMAIL PROTECTED] www.campbell-lange.net -- http://mail.python.org/mailman/listinfo/python-list

Local class variables? (mod_python problem)

2007-02-22 Thread Rory Campbell-Lange
() b.addone() print 'a:', a print 'b:', b -- Rory Campbell-Lange [EMAIL PROTECTED] www.campbell-lange.net -- http://mail.python.org/mailman/listinfo/python-list

Re: Local class variables? (mod_python problem)

2007-02-22 Thread Rory Campbell-Lange
, Rory Campbell-Lange ([EMAIL PROTECTED]) wrote: We have a set of classes using static methods to retain reference variables between operations. The problem is that the static variables are not reset between operations when used through mod_python. Although it is possible to reset the class

Re: Local class variables? (mod_python problem)

2007-02-22 Thread Rory Campbell-Lange
On 22/02/07, Rory Campbell-Lange ([EMAIL PROTECTED]) wrote: In essence we use class variables as follows: class Part (object): totalgia = 0 def __init__(self, gia): self.gia = gia # gross internal area self.giaratio = 0

Maths error

2007-01-08 Thread Rory Campbell-Lange
-- Rory Campbell-Lange [EMAIL PROTECTED] www.campbell-lange.net -- http://mail.python.org/mailman/listinfo/python-list

read sys.stdin, then raw_input

2006-03-02 Thread Rory Campbell-Lange
? : ') Selection? : Traceback (most recent call last): File /tmp/z.py, line 5, in ? sel = raw_input('Selection? : ') EOFError: EOF when reading a line Advice much appreciated. Rory -- Rory Campbell-Lange [EMAIL PROTECTED] www.campbell-lange.net -- http://mail.python.org/mailman/listinfo

Re: read sys.stdin, then raw_input

2006-03-02 Thread Rory Campbell-Lange
To clarify, how can I get a normal terminal prompt for raw_input to enable me to insert a value into variable 'sel'? The program wants to keep reading from the piped file, it seems. Rory On 01/03/06, Rory Campbell-Lange ([EMAIL PROTECTED]) wrote: I'm stumped. I'm piping some content

Re: Newbie errors :-( Need help

2006-03-02 Thread Rory Campbell-Lange
be the reason? fibo.fib(1000) 1 1 2 3 5 8 13 21 34 55 89 144 233 377 610 987Traceback (most recent call last): File interactive input, line 1, in ? File fibo.py, line 8, in fib return result NameError: global name 'result' is not defined -- Rory Campbell-Lange [EMAIL

Re: read sys.stdin, then raw_input

2006-03-02 Thread Rory Campbell-Lange
to my tty sys.stdin = open(/dev/tty) -- Rory Campbell-Lange [EMAIL PROTECTED] www.campbell-lange.net -- http://mail.python.org/mailman/listinfo/python-list

newbie : prune os.walk

2005-03-10 Thread Rory Campbell-Lange
', '2', '3', '4'] /tmp/test/one ['subone'] ['1', '2', '3', '4'] /tmp/test/one/subone [] [] /tmp/test/two [] ['5', '6', '7', '8'] -- Rory Campbell-Lange [EMAIL PROTECTED] www.campbell-lange.net -- http://mail.python.org/mailman/listinfo/python-list

Sorting dictionary by 'sub' value

2005-03-08 Thread Rory Campbell-Lange
' : (0x011A) Ratio=72 @ 174, 'model' : (0x0110) ASCII=PENTAX Optio 330 @ 156, 'size': 367415L, 'orientation' : (0x0112) Short=1 @ 42} Thanks, Rory -- Rory Campbell-Lange [EMAIL PROTECTED] www.campbell-lange.net -- http://mail.python.org/mailman/listinfo/python

Re: Sorting dictionary by 'sub' value

2005-03-08 Thread Rory Campbell-Lange
]) wrote: temp_list = [ (x[1][1], x[0]) for x in d.items() ] ... temp_list.sort() for (tmp, key) in temp_list: -- Rory Campbell-Lange [EMAIL PROTECTED] www.campbell-lange.net -- http://mail.python.org/mailman/listinfo/python-list

Re: Newbie CGI problem

2005-02-20 Thread Rory Campbell-Lange
On 18/02/05, Peter Otten ([EMAIL PROTECTED]) wrote: Rory Campbell-Lange wrote: #!/usr/bin/python import cgi print Content-type: text/html\n\n print hi Gives me the following in my browser: ''' hi Content-type: text/html hi ''' Why are there two 'hi's? You

Newbie CGI problem

2005-02-18 Thread Rory Campbell-Lange
#!/usr/bin/python import cgi print Content-type: text/html\n\n print hi Gives me the following in my browser: ''' hi Content-type: text/html hi ''' Why are there two 'hi's? Thanks, Rory -- Rory Campbell-Lange [EMAIL PROTECTED] www.campbell-lange.net -- http://mail.python.org/mailman

Re: Newbie question about class operator overloading

2005-02-16 Thread Rory Campbell-Lange
Bethard ([EMAIL PROTECTED]) wrote: Rory Campbell-Lange wrote: I am anxious about how best to set and access items one level down in a data structure if I am using __setitem__ and __getitem__. ... object['three'] = [0, 'val0'] # set x = object['three'][0] # get ... py data['one'].foo

Newbie question about class operator overloading

2005-02-15 Thread Rory Campbell-Lange
Campbell-Lange [EMAIL PROTECTED] www.campbell-lange.net -- http://mail.python.org/mailman/listinfo/python-list

Re: Newbie question about class operator overloading

2005-02-15 Thread Rory Campbell-Lange
calls refer to self.data; is it sensible and right to be able to refer to self.data[n]? Rory On 15/02/05, Rory Campbell-Lange ([EMAIL PROTECTED]) wrote: Hi. I'm just starting to use python. I am anxious about how best to set and access items one level down in a data structure if I am using