Fiyawerx wrote:
> Thanks Kent, thats just what I needed, but got stuck in a single mode of
> thought trying to do it inline, didn't even think of adding a separate
> function since the program seemed 'too simple'.
You can always use a lambda if you like that style:
newest = max(first_files, key=
Fiyawerx wrote:
> first_files = [ file for file in data['xls_files'] if u'First Worksheet'
> in xlrd.open_workbook(file).sheet_names() ]
> data['first_file'] = ??
> This is where I get stuck, I'm trying to figure out how, from the files
> that match, I can select the file with the most current t
In psudocode:
#map the files to their time.
filesByTimes = {}
for each in filesInDirectory:
filesByTimes[os.stat(each).st_mtime]=each
#find the largest time
times = filesByTimes.keys()
sort(times)
#retrieve the file that goes with it
latestFile = filesByTimes[times[-1]]
--Michael
On
I'm working on a small script that so far, using the xlrd module, (
http://www.lexicon.net/sjmachin/xlrd.html) will parse all the files in a
given directory for a xls file with a specific worksheet. This way, if the
file names change, or people don't save the spreadsheet with the right name,
my scr
Forwarding to the list...
Original Message
Subject:Re: [Tutor] reading and writing with csv then appending some
data to a specific line
Date: Mon, 5 Nov 2007 14:54:49 +0100
From: pierre cutellic <[EMAIL PROTECTED]>
To: Kent Johnson <[EMAIL PROTECTED]>
References:
Hi, I asked this question last year but got no response.
I'm trying to write a program to test someone's typing speed and show
them their mistakes. However I'm getting weird results when looking
for the differences in longer (than 100 chars) strings:
import difflib
# a tape measure string (just
Garry Willgoose wrote:
> In response to Kent's suggestion here is an updated post showing the
> python code and the error log. The original reason for using try was
> I thought maybe this was scoping problem and that maybe 2nd time
> through the call it needed to import it again from scratch.