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
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] +'":"' +
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
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
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