[Tutor] time vs. timeit

2014-08-26 Thread diliup gabadamudalige
Hi all, 1. why do some say that the time module is more accurate than the timeit module? s = time.time() or s = timeit.timeit() 2. Why is it that both modules never return the same answer on each run? Thank you for your response. -- Diliup Gabadamudalige http://www.diliupg.com http://soft.dil

Re: [Tutor] time vs. timeit

2014-08-26 Thread Chris “Kwpolska” Warrick
On Tue, Aug 26, 2014 at 6:26 AM, diliup gabadamudalige wrote: > Hi all, > > 1. why do some say that the time module is more accurate than the timeit > module? > s = time.time() > or > s = timeit.timeit() > > 2. Why is it that both modules never return the same answer on each run? The two function

Re: [Tutor] simple unicode question

2014-08-26 Thread Albert-Jan Roskam
- Original Message - > From: Danny Yoo > To: Albert-Jan Roskam > Cc: Python Tutor Mailing List > Sent: Saturday, August 23, 2014 2:53 AM > Subject: Re: [Tutor] simple unicode question > > On Fri, Aug 22, 2014 at 2:10 PM, Albert-Jan Roskam > wrote: >>  Hi, >> >>  I have data that is ei

Re: [Tutor] time vs. timeit

2014-08-26 Thread Steven D'Aprano
On Tue, Aug 26, 2014 at 09:56:55AM +0530, diliup gabadamudalige wrote: > Hi all, > > 1. why do some say that the time module is more accurate than the timeit > module? > s = time.time() > or > s = timeit.timeit() You will have to ask them. Since the two functions do very different things, I don'

Re: [Tutor] simple unicode question

2014-08-26 Thread Steven D'Aprano
On Tue, Aug 26, 2014 at 03:58:17AM -0700, Albert-Jan Roskam wrote: > Interesting, you follow a "look before you leap" approach here, > whereas `they` always say it is easier to ”ask forgiveness than > permission” in python. Anyone who says it is *ALWAYS* easier is lying or confused :-) It is

Re: [Tutor] Preparing virtualenvwrapper for Django 1.6 development

2014-08-26 Thread Walter Prins
Hi, To add: On 23 August 2014 08:54, Chris “Kwpolska” Warrick wrote: > > On Fri, Aug 22, 2014 at 11:23 PM, Sithembewena Lloyd Dube > wrote: > > I am developing on a Windows 8.1 machine and wold like to setup > > virtualenvironment via virtualenvwrapper so as to have a properly set up > > Python

[Tutor] datetime substraction

2014-08-26 Thread Anirudh Tamsekar
Hi, I'm writing a script to monitor rsyslog (second level check). Overview: We have Monit for monitoring rsyslog, however we need a script to do a second level checks. I'm looking for a script which will check if rsyslog is being updated, also log rotation is happening. Incase of the new file c

Re: [Tutor] datetime substraction

2014-08-26 Thread Steven D'Aprano
On Tue, Aug 26, 2014 at 02:40:30PM +0530, Anirudh Tamsekar wrote: > I have written a script, however I'm not able to get the date substraction > math right, getting the following error > (Searched google and other resources too). > > *Traceback (most recent call last):* > * File "./rsyslog_check

Re: [Tutor] datetime substraction

2014-08-26 Thread Alan Gauld
On 26/08/14 10:10, Anirudh Tamsekar wrote: *Traceback (most recent call last):* * File "./rsyslog_check.py", line 22, in * *difft=cur_time-mt* *TypeError: unsupported operand type(s) for -: 'str' and 'str'* Request your help. Also point any good documentation where I can get quick referenc

Re: [Tutor] datetime substraction

2014-08-26 Thread Danny Yoo
> > I have written a script, however I'm not able to get the date substraction > math right, getting the following error > (Searched google and other resources too). > > Traceback (most recent call last): > File "./rsyslog_check.py", line 22, in > difft=cur_time-mt > TypeError: unsupported o