Hi --
I am trying to do some event abstraction to mine a set of HTTP logs.
We have a pretty clean stateless architecture with user IDs that
allows us to understand what is retrieved on each session, and should
allow us to detect the higher-order user activity from the logs.
Ideally I'd love a pyth
Hi --
Is there a clean pythonic way to check for network connectivity? I
have a script that needs to run periodically on a laptop to create a
local cache of some network files. I would like it to fail gracefully
when disconnected, as well as issue a warning if it hasn't been able
to connect for X
>
> Any chance you are doing this on Windows and Excel doesn't like the
> return+linefeed line endings that Windows produces when writing files in
> text mode? Try 'wb' as mode for the output file.
>
> Ciao,
> Marc 'BlackJack' Rintsch
>
Fixed! Can't believe I missed that...
Thank you for
Hi --
Is there a standard way to use the csv module to export data that
contains multi-line values to Excel? I can get it mostly working, but
Excel seems to have difficulty displaying the generated multi-line
cells.
The following reproduces the problem in python 2.5:
import csv
row = [1,"hello",
>
> i don't think that using flat text files as a database is common these
> days. if you need relational database features what stops you from
> using rdbms? if the only reason for that is some legacy system then
> i'd still use in-memory sqlite database for all relational operations.
> import, pr
Maybe http://twill.idyll.org/
--
http://mail.python.org/mailman/listinfo/python-list
Hello --
Is there a convention, library or Pythonic idiom for performing
lightweight relational operations on flatfiles? I frequently find
myself writing code to do simple SQL-like operations between flat
files, such as appending columns from one file to another, linked
through a common id. For ex
Thanks for all the postings. I can't change delimiter in the source
itself, so I'm doing it temporarily just to handle the escaping:
def splitWithEscapedCommasInParens(s, trim=False):
pat = re.compile(r"(.+?\([^\(\),]*?),(.+?\).*)")
while pat.search(s):
s = re.sub(p
Hi --
I am trying to use the csv module to parse a column of values
containing comma-delimited values with unusual escaping:
AAA, BBB, CCC (some text, right here), DDD
I want this to come back as:
["AAA", "BBB", "CCC (some text, right here)", "DDD"]
I think this is probably non-standard escapi
> Or can be used directly as an integer index to get a character
>
> >>> ['01'[x in a] for x in xrange(10)]
> ['0', '0', '0', '1', '1', '0', '1', '0', '0', '0']
>
Very cool -- this does the trick nicely and seems quite extensible,
now that I get the basic idiom.
Belated thanks for the quick re
Hi --
I'm using the csv module to parse a tab-delimited file and wondered
whether there was a more elegant way to skip an possible header line.
I'm doing
line = 0
reader = csv.reader(file(filename))
for row in reader:
if (ignoreFirstLine & line == 0):
11 matches
Mail list logo