Re: [Tutor] comparing dates

2007-11-23 Thread Chris Calloway
On Nov 24, 2007, at 12:27 AM, Lawrence Shafer wrote: How would I compare these two dates and extract the difference in H:M:S?? http://docs.python.org/lib/module-datetime.html http://docs.python.org/lib/datetime-timedelta.html 22 Nov 2007 18:54:07 23 Nov 2007 23:24:23 >>> import datetime >>

Re: [Tutor] comparing dates

2007-11-23 Thread Shantanoo Mahajan
On 24-Nov-07, at 10:57 AM, Lawrence Shafer wrote: > How would I compare these two dates and extract the difference in > H:M:S?? > > 22 Nov 2007 18:54:07 > 23 Nov 2007 23:24:23 You can try, 'datetime' module. 'http://pleac.sourceforge.net/pleac_python/datesandtimes.html' may be useful. regar

Re: [Tutor] comparing dates

2007-11-23 Thread Steve Willoughby
Lawrence Shafer wrote: > How would I compare these two dates and extract the difference in H:M:S?? > > 22 Nov 2007 18:54:07 > 23 Nov 2007 23:24:23 Look at the datetime module's timedelta operations. ___ Tutor maillist - Tutor@python.org http://mail.p

[Tutor] comparing dates

2007-11-23 Thread Lawrence Shafer
How would I compare these two dates and extract the difference in H:M:S?? 22 Nov 2007 18:54:07 23 Nov 2007 23:24:23 Cheers, Lawrence ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] network - send one line of text

2007-11-23 Thread Steve Willoughby
Michael Langford wrote: > On 11/23/07, elis aeris <[EMAIL PROTECTED]> wrote: >> is it possible to do this with python? >> >> >> a server script to listen for >> >> a client script, it sends a line of text to server when a given criteria is >> met. > > Sounds like python may not be simplest path to

Re: [Tutor] network - send one line of text

2007-11-23 Thread Michael Langford
On 11/23/07, elis aeris <[EMAIL PROTECTED]> wrote: > is it possible to do this with python? > > > a server script to listen for > > a client script, it sends a line of text to server when a given criteria is > met. Sounds like python may not be simplest path to solving your problem. If you're on a

Re: [Tutor] network - send one line of text

2007-11-23 Thread Alan Gauld
"elis aeris" <[EMAIL PROTECTED]> wrote > a server script to listen for > > a client script, it sends a line of text to server when a given > criteria is > met. > > is this possible to do with python? Yes its standard socket programming. Take a look at my tutorial, specifically the Network Prog

Re: [Tutor] network - send one line of text

2007-11-23 Thread bob gailer
elis aeris wrote: > is it possible to do this with python? > > > a server script to listen for > > a client script, it sends a line of text to server when a given > criteria is met. > > > i just need to send text alone, and then code it best kept simple, > > is this possible to do with python? see

[Tutor] network - send one line of text

2007-11-23 Thread elis aeris
is it possible to do this with python? a server script to listen for a client script, it sends a line of text to server when a given criteria is met. i just need to send text alone, and then code it best kept simple, is this possible to do with python?

Re: [Tutor] python 2.4 reading files - unexpected behaviour

2007-11-23 Thread bob gailer
John Gerdeman wrote: > Hello, > > I got a csv file, in which I have to count the occurrences of certain > numbers in columns. I can do this for one arbitrary column, but not for > all. > > The problem I encountered is as follows. Iterating through the rows of a > file works, but as soon as I try t

[Tutor] python 2.4 reading files - unexpected behaviour

2007-11-23 Thread John Gerdeman
Hello, I got a csv file, in which I have to count the occurrences of certain numbers in columns. I can do this for one arbitrary column, but not for all. The problem I encountered is as follows. Iterating through the rows of a file works, but as soon as I try to iterate through the same file aga

Re: [Tutor] 2-D array to string

2007-11-23 Thread Eli Brosh
Thank you very much Evert. Starting from your advice, I used: a=numpy.array([[100,2,3],[4,5,6],[7,8,9]]) s=repr(a).replace('array',' ') s=' '+''.join([ c for c in s if c not in ('(', ')','[',']',',')]) print s This gave the correct result. So, the problem is solved. The reason I wanted the

Re: [Tutor] 2-D array to string

2007-11-23 Thread Evert Rol
> I am starting to use pylab/numpy/scipy instead of MATLAB. > I now have a real beginners question (I think it is not really > related to numpy) > I have a two-dimensional array > a=[[1,2,3],[4, 5, 6],[7,8,9]] > > Is there a simple way to turn it into a multiline string ? > > That is, turn a into

[Tutor] 2-D array to string

2007-11-23 Thread Eli Brosh
Hello I am starting to use pylab/numpy/scipy instead of MATLAB. I now have a real beginners question (I think it is not really related to numpy) I have a two-dimensional array a=[[1,2,3],[4, 5, 6],[7,8,9]] Is there a simple way to turn it into a multiline string ? That is, turn a into: s='''1 2

[Tutor] Display Vietnamese characters with GnoChm

2007-11-23 Thread Le Van
Hi all, I'm using CHM Viewer 0.9.11 running in Ubuntu 7.10. When open an .chm file, I got this warning "Your Python installation does not support Vietnamese (Vietnamese - None). It is like that the characters in the navigation tabs will not be correctly displayed." Then it does not display text cor