Peter Machell wrote:
> Scott David Daniels wrote:
> > Peter Machell wrote:
> >> ZeD wrote:
> >>
> >> Thanks very much ZeD. This will do what I need to.
> >> The next step is to do some regex on the phone number to ensure it's
> >> local and correct. How can I split these up so each value has a key
At Tuesday 26/12/2006 18:57, Peter Machell wrote:
for x in bar:
fname = x[0]
if fname == "":
fname == "None"
sname = x[1]
if sname == "":
sname == "None"
print ""+fname+""+""+sname+""
Except that
Peter Machell wrote:
> I can almost do it this way:
>
> for x in bar:
> fname = x[0]
> if fname == "":
> fname == "None"
> sname = x[1]
> if sname == "":
> sname == "None"
>
> print ""+fname+""+""+sname+""
Scott David Daniels wrote:
> Peter Machell wrote:
>> ZeD wrote:
>>
>> Thanks very much ZeD. This will do what I need to.
>> The next step is to do some regex on the phone number to ensure it's
>> local and correct. How can I split these up so each value has a key?
>
> Well, you should try that,
Peter Machell wrote:
> ZeD wrote:
>
> Thanks very much ZeD. This will do what I need to.
> The next step is to do some regex on the phone number to ensure it's
> local and correct. How can I split these up so each value has a key?
Well, you should try that, unless you intend to get the newsgrou
ZeD wrote:
> Peter Machell wrote:
>
>> I have an application where I need to take a query from an existing
>> database and send it to a web api.
>
> [...]
>
>> There are always 5 values, but some are blank and some are 'None'.
>> I'd like to split the lines so I get something resembling XML, lik
Peter Machell wrote:
> I have an application where I need to take a query from an existing
> database and send it to a web api.
[...]
> There are always 5 values, but some are blank and some are 'None'.
> I'd like to split the lines so I get something resembling XML, like this:
> Frank
> Spencer
I have an application where I need to take a query from an existing
database and send it to a web api.
Here's a cut down version of my existing code:
for foo in mssql.fetch_array();
bar = foo[2] #trims the first result which we don't use
for x in bar:
for y in x