Newbi Q: Recursively reverse lists but NOT strings?

2007-10-14 Thread Dmitri O.Kondratiev
The function I wrote (below) reverses lists all right: def reverse(xs): if xs == []: return [] else: return (reverse (xs[1:])) + [xs[0]] >>> reverse ([1,2,3]) [3, 2, 1] >>> Yet when I try to reverse a string I get: >>> reverse ("abc") ... ... ... File "C:\wks\pyth

Re: Newbi Q: Recursively reverse lists but NOT strings?

2007-10-15 Thread Dmitri O.Kondratiev
g a reversed copy of either a string or a list, but what does '::-1' syntax means? Thanks, Dmitri O. Kondratiev [EMAIL PROTECTED] http://www.geocities.com/dkondr On 10/15/07, Gary Herron <[EMAIL PROTECTED]> wrote: > > Dmitri O.Kondratiev wrote: > > > >

Newbi Q: What is a rational for strings not being lists in Python?

2007-10-15 Thread Dmitri O.Kondratiev
? Thanks, -- Dmitri O. Kondratiev [EMAIL PROTECTED] http://www.geocities.com/dkondr On 10/15/07, Dmitri O.Kondratiev <[EMAIL PROTECTED]> wrote: > > Gary, thanks for lots of info! > Python strings are not lists! I got it now. That's a pity, I need two > different functions: one to

Re: Newbi Q: What is a rational for strings not being lists in Python?

2007-10-16 Thread Dmitri O.Kondratiev
On 10/16/07, Matt McCredie <[EMAIL PROTECTED]> wrote: [quote] > The example you posted won't work with tuples either because they, > like strings, are also immutable. So, the best way to get the posted > code to work (which is a bad way to go about reversing a string, but I > digress) > [end-quote

Using Python to access CORBA server?

2007-10-16 Thread Dmitri O.Kondratiev
Need advice: What library can Python client use to access CORBA server using DII (Dynamic Invocation Interface) ? Thanks, Dima -- http://mail.python.org/mailman/listinfo/python-list

Millisecond timestamp function?

2007-10-19 Thread Dmitri O.Kondratiev
What Python module / function can be used to get millisecond timestamps? time.time() returns the time as a floating point number expressed in seconds since the epoch, in UTC. Thanks! -- Dmitri O. Kondratiev [EMAIL PROTECTED] http://www.geocities.com/dkondr -- http://mail.python.org/mailman/listi

How to get milliseconds when substructing datetime objects?

2007-12-12 Thread Dmitri O.Kondratiev
Please help to find simple solutiion for measuring times of operations with millisecond precision. For this I am trying to use datetime() objects: import time import datetime def dreamTime(secs): t1 = datetime.datetime.now() time.sleep(secs) t2 = datetime.datetime.now() dt = t2 -

Re: How to get milliseconds when substructing datetime objects?

2007-12-13 Thread Dmitri O.Kondratiev
ect ]<http://mail.python.org/pipermail/python-list/2007-December/subject.html#469507> [ author ]<http://mail.python.org/pipermail/python-list/2007-December/author.html#469507> ------ En Wed, 12 Dec 2007 11:40:24 -0300, Dmitri O.Kondratiev http://mail.python.org/

Re: How to get milliseconds when substructing datetime objects?

2007-12-13 Thread Dmitri O.Kondratiev
y have a library with *extra* datetime functions (and better written then these ones) please let me know! -- Dmitri O. Kondratiev [EMAIL PROTECTED] http://www.geocities.com/dkondr *Dmitri O.Kondratiev* dokondr at gmail.comwrote: *Thu Dec 13 16:19:35 CET 2007* - Previous message: to Doctest as