sys.path and loads the main script.
...
Hi Waldemar. Thanks for your advice. I'll have another play with py2exe.
Many thanks
Rory
--
Rory Campbell-Lange
r...@campbell-lange.net
--
http://mail.python.org/mailman/listinfo/python-list
tomate 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
.listdir and fnmatch.fnmatch functions
internally, so is definitely the way to go.
http://docs.python.org/library/glob.html
--
Rory Campbell-Lange
r...@campbell-lange.net
--
http://mail.python.org/mailman/listinfo/python-list
7;m a bit rusty, and have just picked up the new "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-la
or x in pres:
> ... res.append((x, d[x]))
> ...
> >>> res
> [(2, ('u', 9, 8)), (5, ('r', 21, 10)), (1, ('a', 1, 12))]
How about
>>> mylist = [z for z in zip(list(d), list(d.values()))]
and then sort on your sort criteria, either i
butes
--
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
to do with
the output from your programme.
--
Rory Campbell-Lange
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
r example. However, I presume that is not the desired
> usecase, from what I can extract from your posts I presume 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]>
--
http://mail.python.org/mailman/listinfo/python-list
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
>
Kind regards
Rory
On 22/02/07, 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.
&g
a.incrementer()
a.addone()
b = TryMe()
b.incrementer()
b.addone()
print 'a:', a
print 'b:', b
--
Rory Campbell-Lange
<[EMAIL PROTECTED]>
--
http://mail.python.org/mailman/listinfo/python-list
much appreciated;
Rory
--
Rory Campbell-Lange
<[EMAIL PROTECTED]>
--
http://mail.python.org/mailman/listinfo/python-list
>
...
> # rebind sys.stdin to my tty
> sys.stdin = open("/dev/tty")
--
Rory Campbell-Lange
<[EMAIL PROTECTED]>
--
http://mail.python.org/mailman/listinfo/python-list
at could 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 "", line 1, in ?
> File "fibo.py", line 8, in fib
> return result
> NameError: global name &
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 p
raw_input('Selection? : ')
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]>
--
http://mail.python.org/mailman/listinfo/python-list
t, dirs, files
...
/tmp/test ['one', 'two'] ['1', '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]>
--
http://mail.python.org/mailman/listinfo/python-list
t; decorated = [(value[9]['date'], key)
> for key, value in v.iteritems()]
> decorated.sort()
> result = [key for key, date in decorated]
On 08/03/05, Batista, Facundo ([EMAIL PROTECTED]) 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]>
--
http://mail.python.org/mailman/listinfo/python-list
,
'date': (0x9004) ASCII=2004:12:07 00:18:20 @ 514,
'x' : (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]>
--
http://mail.python.org/mailman/listinfo/python-list
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:
&g
#!/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]>
--
http://mail.python.org/mailman/listinfo/python-list
ful for your help.
Rory
On 15/02/05, Steven 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'
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 struct
else:
return self.data[key]
--
Rory Campbell-Lange
<[EMAIL PROTECTED]>
--
http://mail.python.org/mailman/listinfo/python-list
24 matches
Mail list logo