Ah! Thanks :)
V
On Fri, Oct 9, 2009 at 1:10 PM, Stephen Hansen wrote:
>
>
> On Fri, Oct 9, 2009 at 11:04 AM, Victor Subervi
> wrote:
>
>> So, because the results in sstp were duplicates ( ['prescriptions',
>> 'prescriptions'] ) it only returned one result in the dict(zip()) statement.
>> Weird.
On Fri, Oct 9, 2009 at 11:04 AM, Victor Subervi wrote:
> So, because the results in sstp were duplicates ( ['prescriptions',
> 'prescriptions'] ) it only returned one result in the dict(zip()) statement.
> Weird. Bug or feature? ;)
> Thanks,
> V
Feature.
zip() returned two results, but dictiona
So, because the results in sstp were duplicates ( ['prescriptions',
'prescriptions'] ) it only returned one result in the dict(zip()) statement.
Weird. Bug or feature? ;)
Thanks,
V
On Fri, Oct 9, 2009 at 12:37 PM, Stephen Hansen wrote:
>
>
> Changing the line:
>> subtypes = dict(zip(sstp, sst))
Changing the line:
> subtypes = dict(zip(sstp, sst))
> to:
> subtypes = dict(zip(sst, sstp))
> as I believe Stephen misread it to be causes the zip operation to return:
> [('doctors', 'prescriptions'), ('patient', 'prescriptions')]
> and thus the dict will contain:
> {'patient': 'prescriptions', '
You're right...how strange. Here's the whole code:
tables = []
bst = []
bdt = []
spt = []
sst = []
sstp = []
cursor.execute('show tables;')
all = cursor.fetchall()
for a in all:
tables.append(a[0])
for table in tables:
if table[0] == 'b': # This is a basic table
i
On Fri, Oct 9, 2009 at 10:10 AM, Stephen Hansen wrote:
>
>
> On Fri, Oct 9, 2009 at 10:02 AM, Victor Subervi
> wrote:
>
>> Hi;
>> I have the following code:
>>
>> elif table[0] == 't': # This is a store subtype table
>> bits = string.split(table, '0')
>> sst.append(bits[2])
>>
On Fri, Oct 9, 2009 at 10:02 AM, Victor Subervi wrote:
> Hi;
> I have the following code:
>
> elif table[0] == 't': # This is a store subtype table
> bits = string.split(table, '0')
> sst.append(bits[2])
> sstp.append(bits[1])
> subtypes = dict(zip(sstp, sst))
>
> When I pr
Hi;
I have the following code:
elif table[0] == 't': # This is a store subtype table
bits = string.split(table, '0')
sst.append(bits[2])
sstp.append(bits[1])
subtypes = dict(zip(sstp, sst))
When I print these out to screen, I get this:
sst: ['doctors', 'patient']
sstp: ['