Re: Automatically Writing a Dictionary

2008-01-25 Thread tonylabarbara
d = {}? ? for line in input:? ? key, value = line.split(',').rstrip('\n')? ? d[key] = value? Thanks. That worked except for the rstrip. So I did this: for line in input: ? line = string.rstrip(line, '\n') ? key, value = line.split(',') ? dictionary[key] = value Thanks again, Tony

Automatically Writing a Dictionary

2008-01-23 Thread tonylabarbara
Hi; I have data in a file and I would like to write it to a dictionary, and then perform commands on it, something like this: input = "/usr/local/machine-lang-trans/dictionary.txt" input = open(input,'r') dict = "{" for line in input: ? tup = re.split(','line) ? dict += '"' + tup[0] +'":"' +

PIL Problem

2007-11-07 Thread tonylabarbara
Hi; I´ve installed Zope 2.10.5 on top of Python 2.4.2 (not optimal, but it will work, according to the build instructions). I installed Plone 3.0.2 and I get errors when I crank up Zope, all related to a non-existent PIL. So I d/l/d the latest PIL, plopped it in my Extensions dir, ran this: py

Editing MS Word

2007-10-26 Thread tonylabarbara
Hi; I'm trying to edit MS Word tables with a python script. Here's a snippet: import string def msw2htmlTables(): input = "/usr/home/me/test.doc" input = open(input,'r') word = "whatever" inputFlag = 0 splitString = [] for line in input: # Check first the inputFlag, since we only want to

Form-Through-Script Nightmare

2007-08-14 Thread tonylabarbara
Hi; I originally submitted this to the Zope list, but after no replies and realizing it's probably better suited for the python list, I'm submitting it here. I have a form where purchasers can deselect items they've added to their shopping cart. All the hidden fields have been numbered accordi