Re: getfirst and re

2010-01-08 Thread Victor Subervi
On Fri, Jan 8, 2010 at 3:37 PM, MRAB wrote: > Victor Subervi wrote: > >> On Fri, Jan 8, 2010 at 3:09 PM, Victor Subervi >> > victorsube...@gmail.com>> wrote: >> >> >> >>On Fri, Jan 8, 2010 at 2:52 PM, Jean-Michel Pichavant >>mailto:jeanmic...@sequans.com>> wrote: >> >>Victor Sube

Re: getfirst and re

2010-01-08 Thread MRAB
Victor Subervi wrote: On Fri, Jan 8, 2010 at 3:09 PM, Victor Subervi > wrote: On Fri, Jan 8, 2010 at 2:52 PM, Jean-Michel Pichavant mailto:jeanmic...@sequans.com>> wrote: Victor Subervi wrote: On Fri, Jan 8, 2010 at 1:26 PM, Steve H

Re: getfirst and re

2010-01-08 Thread Victor Subervi
On Fri, Jan 8, 2010 at 3:21 PM, MRAB wrote: > Victor Subervi wrote: > > On Fri, Jan 8, 2010 at 1:26 PM, Steve Holden > st...@holdenweb.com>> wrote: >> >>MRAB wrote: >> > Victor Subervi wrote: >> > [snip] >> >> >> >> Code snippet: >> >> >> >> def cgiFieldStorageToDict(

Re: getfirst and re

2010-01-08 Thread MRAB
Victor Subervi wrote: On Fri, Jan 8, 2010 at 1:26 PM, Steve Holden > wrote: MRAB wrote: > Victor Subervi wrote: > [snip] >> >> Code snippet: >> >> def cgiFieldStorageToDict(fieldStorage):

Re: getfirst and re

2010-01-08 Thread Victor Subervi
On Fri, Jan 8, 2010 at 3:09 PM, Victor Subervi wrote: > > > On Fri, Jan 8, 2010 at 2:52 PM, Jean-Michel Pichavant < > jeanmic...@sequans.com> wrote: > >> Victor Subervi wrote: >> >> On Fri, Jan 8, 2010 at 1:26 PM, Steve Holden >> st...@holdenweb.com>> wrote: >>> >>>MRAB wrote: >>>> Victor

Re: getfirst and re

2010-01-08 Thread Victor Subervi
On Fri, Jan 8, 2010 at 2:52 PM, Jean-Michel Pichavant < jeanmic...@sequans.com> wrote: > Victor Subervi wrote: > > On Fri, Jan 8, 2010 at 1:26 PM, Steve Holden > st...@holdenweb.com>> wrote: >> >>MRAB wrote: >>> Victor Subervi wrote: >>> [snip] >>>> >>>> Code snippet: >>>>

Re: getfirst and re

2010-01-08 Thread Victor Subervi
On Fri, Jan 8, 2010 at 2:52 PM, Jean-Michel Pichavant < jeanmic...@sequans.com> wrote: > Victor Subervi wrote: > > On Fri, Jan 8, 2010 at 1:26 PM, Steve Holden > st...@holdenweb.com>> wrote: >> >>MRAB wrote: >>> Victor Subervi wrote: >>> [snip] >>>> >>>> Code snippet: >>>>

Re: getfirst and re

2010-01-08 Thread Jean-Michel Pichavant
Victor Subervi wrote: On Fri, Jan 8, 2010 at 1:26 PM, Steve Holden > wrote: MRAB wrote: > Victor Subervi wrote: > [snip] >> >> Code snippet: >> >> def cgiFieldStorageToDict(fieldStorage): Fur

Re: getfirst and re

2010-01-08 Thread Victor Subervi
On Fri, Jan 8, 2010 at 1:26 PM, Steve Holden wrote: > MRAB wrote: > > Victor Subervi wrote: > > [snip] > >> > >> Code snippet: > >> > >> def cgiFieldStorageToDict(fieldStorage): > > Further hint ... > > >> params = {} > >> for key in fieldStorage.keys

Re: getfirst and re

2010-01-08 Thread Steve Holden
MRAB wrote: > Victor Subervi wrote: > [snip] >> >> Code snippet: >> >> def cgiFieldStorageToDict(fieldStorage): Further hint ... >> params = {} >> for key in fieldStorage.keys(): >> params[key] = cgi.FieldStorage[key].value > ^^

Re: getfirst and re

2010-01-08 Thread MRAB
Victor Subervi wrote: [snip] Code snippet: def cgiFieldStorageToDict(fieldStorage): params = {} for key in fieldStorage.keys(): params[key] = cgi.FieldStorage[key].value ^ This is your problem. return params [snip] -- http://mail.python.or

Re: getfirst and re

2010-01-08 Thread Carsten Haese
Victor Subervi wrote: > First I get scolded for not including enough information. Now I get > scolded for including too much. Seems I can't win. I *am* putting effort > into understanding this. I'm sorry I'm not as sharp as you are in these > matters. I didn't scold you for including too much info

Re: getfirst and re

2010-01-08 Thread Steve Holden
Victor Subervi wrote: [...] > TypeError: unsubscriptable object > args = ('unsubscriptable object',) > > Why is the value undefined? What is an unsubscriptable object? > TIA, > beno > Sorry, that wasn't very helpful. Here's some more advice: Google is you friend. Try Googling for component

Re: getfirst and re

2010-01-08 Thread Steve Holden
Victor Subervi wrote: > On Fri, Jan 8, 2010 at 10:11 AM, Carsten Haese > wrote: > > Victor Subervi wrote: > > Code snippet: > > [...] > > > > Error: > > [...] > > What do? > > After eliminating the pieces of your post that have been

Re: getfirst and re

2010-01-08 Thread Victor Subervi
On Fri, Jan 8, 2010 at 10:11 AM, Carsten Haese wrote: > Victor Subervi wrote: > > Code snippet: > > [...] > > > > Error: > > [...] > > What do? > > After eliminating the pieces of your post that have been copied or > quoted from elsewhere, I am left with a total of five words of your own > to ask

Re: getfirst and re

2010-01-08 Thread Carsten Haese
Victor Subervi wrote: > Code snippet: > [...] > > Error: > [...] > What do? After eliminating the pieces of your post that have been copied or quoted from elsewhere, I am left with a total of five words of your own to ask this question, which seems to be approximately the same amount of effort yo

Re: getfirst and re

2010-01-08 Thread Victor Subervi
On Wed, Jan 6, 2010 at 2:19 PM, Victor Subervi wrote: > On Wed, Jan 6, 2010 at 3:09 PM, Carsten Haese wrote: > >> Victor Subervi wrote: >> > I have an automatically generated HTML form from which I need to extract >> > data to the script which this form calls (to which the information is >> > sent

Re: getfirst and re

2010-01-06 Thread Victor Subervi
On Wed, Jan 6, 2010 at 3:09 PM, Carsten Haese wrote: > Victor Subervi wrote: > > I have an automatically generated HTML form from which I need to extract > > data to the script which this form calls (to which the information is > > sent). > > Ideally, the script that receives the submitted fields

Re: getfirst and re

2010-01-06 Thread Carsten Haese
Victor Subervi wrote: > I have an automatically generated HTML form from which I need to extract > data to the script which this form calls (to which the information is > sent). Ideally, the script that receives the submitted fields should know how the form was generated, so it knows what fields t

Re: getfirst and re

2010-01-06 Thread Victor Subervi
On Wed, Jan 6, 2010 at 1:59 PM, Tim Chase wrote: > Victor Subervi wrote: > >> On Wed, Jan 6, 2010 at 1:27 PM, Tim Chase > >wrote: >> >> But if you're using it on HTML form text, regexps are usually the wrong >>> tool, and you should be using an HTML parser (such as BeautifulSoup) that >>> knows h

Re: getfirst and re

2010-01-06 Thread Tim Chase
Victor Subervi wrote: On Wed, Jan 6, 2010 at 1:27 PM, Tim Chase wrote: But if you're using it on HTML form text, regexps are usually the wrong tool, and you should be using an HTML parser (such as BeautifulSoup) that knows how to handle odd text and escapings better and more robustly than regex

Re: getfirst and re

2010-01-06 Thread Victor Subervi
On Wed, Jan 6, 2010 at 1:27 PM, Tim Chase wrote: > But if you're using it on HTML form text, regexps are usually the wrong > tool, and you should be using an HTML parser (such as BeautifulSoup) that > knows how to handle odd text and escapings better and more robustly than > regexps will. > I hav

Re: getfirst and re

2010-01-06 Thread Tim Chase
I need to do something like the following: pat = re.compile('edit[0-9]*:[0-9]*') check = form.getfirst(pat) (to check things like 'edit0:1') How do I do this? Well, you can do it either as check = pat.search(string_to_search) which is pretty plainly detailed in the help for the "re

getfirst and re

2010-01-06 Thread Victor Subervi
Hi; I need to do something like the following: pat = re.compile('edit[0-9]*:[0-9]*') check = form.getfirst(pat) (to check things like 'edit0:1') How do I do this? TIA, beno -- The Logos has come to bear http://logos.13gems.com/ -- http://mail.python.org/mailman/listinfo/python-list