Calculating timespan

2008-09-28 Thread Erhard
I've been looking at the date/time classes and I'm at a loss as to how to do this (probably too used to other platforms). I have two date/time values. One represents 'now' and the other the last modified time of a file on disk (from stat). I need to calculate the difference in time (i.e., a 't

Re: Calculating timespan

2008-09-28 Thread Erhard
[EMAIL PROTECTED] wrote: from datetime import datetime, timedelta span = datetime.now() - datetime(year=2008,month=8,day=27,hour=12,minute=34,second=56) if span < timedelta(minutes=37): # do something timedelta! Yes, it's obvious that's what I was looking for. I was stuck with 'timespan' i

Re: PEP 3107 and stronger typing (note: probably a newbie question)

2007-07-19 Thread Juergen Erhard
On Thu, Jul 12, 2007 at 11:26:22AM -0700, Paul Rubin wrote: > > Guy Steele used to describe functional programming -- the evaluation > of lambda-calculus without side effects -- as "separation of Church > and state", a highly desirable situation ;-). > > (For non-FP nerds, the above is a pun refe

Auto execute python in USB flash disk

2007-03-27 Thread Brian Erhard
I am still fairly new to python and wanted to attempt a home made password protection program. There are files that I carry on a USB flash drive that I would like to password protect. Essentially, I would like to password protect an entire directory of files. Is there a way to auto execute a pyt

Event: First meeting of Karlsruhe User Group (tentatively named "KaPy"), 2010-04-16, 19:00:00 CEST

2010-04-09 Thread Jürgen Erhard
A new user group is being set up by some interested pythoneers from (around) Karlsruhe. The first meeting will be on Friday, 2010-04-16 (April 16th, 2010) at 19:00 (7pm) in the rooms of Entropia eV (the local affiliate of the CCC). See http://entropia.de/wiki/Anfahrt on how to get there. Or repl

KaPy -- Karlsruhe Python User Group meeting, 2010-05-21, 19:00

2010-05-19 Thread Jürgen Erhard
The Karlsruhe Python User Group (KaPy) meets again. Friday, 2010-04-16 (May 21st) at 19:00 (7pm) in the rooms of Entropia eV (the local affiliate of the CCC). See http://entropia.de/wiki/Anfahrt on how to get there. For your calendars: meetings are held monthly, on the 3rd Friday. Bye, J PS: S

Re: Python Error

2012-07-29 Thread Jürgen A . Erhard
On Sun, Jul 29, 2012 at 01:08:57PM +0200, Peter Otten wrote: > subhabangal...@gmail.com wrote: > > > Dear Group, > > > > I was trying to convert the list to a set, with the following code: > > > > set1=set(list1) > > > > the code was running fine, but all on a sudden started to give the > > fol

Re: Linux shell to python

2012-07-30 Thread Jürgen A . Erhard
On Mon, Jul 30, 2012 at 12:35:38PM +0200, Philipp Hagemeister wrote: > On 07/30/2012 09:05 AM, Vikas Kumar Choudhary wrote: > > `lspci | grep Q | grep "$isp_str1" | grep "$isp_str2" | cut -c1-7' > > The rough Python equivalent would be > > import subprocess > [ l.partition(' ')[0] # or l[:7

Re: On-topic: alternate Python implementations

2012-08-04 Thread Jürgen A . Erhard
On Sat, Aug 04, 2012 at 08:40:16AM +0200, Stefan Behnel wrote: > Steven D'Aprano, 04.08.2012 08:15: > > Most people are aware, if only vaguely, of the big Four Python > > implementations: > > > > And not to forget Cython, which is the only static Python compiler that is > widely used. Compiles a

Re: On-topic: alternate Python implementations

2012-08-05 Thread Jürgen A . Erhard
On Sun, Aug 05, 2012 at 07:46:59AM +0200, Stefan Behnel wrote: > Jürgen A. Erhard, 05.08.2012 01:25: > > On Sat, Aug 04, 2012 at 08:40:16AM +0200, Stefan Behnel wrote: > >> Steven D'Aprano, 04.08.2012 08:15: > >>> Most people are aware, if o