On Saturday, October 15, 2016 at 12:27:42 AM UTC-7, Peter Otten wrote:
> 38016...@gmail.com wrote:
>
> > nums=['3','30','34','32','9','5']
> > I need to sort the list in order to get the largest number string:
> > '953433230'
> >
> > nums.sort(cmp=lambda a,b: cmp(a+b, b+a), reverse=True)
> >
k, I'd
appreciate it.
Thanks,
On Sat, Apr 11, 2009 at 4:18 PM, George Sakkis wrote:
> On Apr 11, 3:03 pm, Mike H wrote:
>
>> Can I not use the cursor.execute command to pass variables that aren't
>> immediately next to each other? If so, is there a better way to go
>&
ht
syntax to use near ''name', 'fileno', 'size') VALUES ('Test',
'AAA-000', 7)' at line 1")
Can I not use the cursor.execute command to pass variables that aren't
immediately next to each other? If so, is there a better way to go
a
Well, I'm an idiot. Obviously, the line "VALUES (%s, %s, %s);" needs
to be modified to adapt for the number of arguments in the list. But
otherwise
On Sat, Apr 11, 2009 at 11:28 AM, Mike H wrote:
> Ok, thanks again to everyone for their suggestions, even if it appears
>
Lcmd="INSERT INTO " + myTable + " (%s) " % ", ".join(myFields)
SQLcmd=SQLcmd + "VALUES (%s,%s,%s);"
cursor.execute(SQLcmd, (myValues))
#sets and returns SQL variable.
SQLcmd="select " + myReturnKey + ":=last_insert_id();"
c
, 1, 'two'] and have a function correct the
list for me, rather than calling the function with a strangely quoted
list e.g. ['"'test'"', 1, '"'two'"'].
Again, thanks.
On Fri, Apr 10, 2009 at 5:18 PM, John Yeung wrote:
> On
Hello all, I have a question about the if/else aspect of list comprehension:
I would like to go through a list and place quotes around an item if
it is a string, and keep the item the same if it's anything else:
e.g.['a',9,'8b'] --> ['"a"', 9, '"8b"']
I understand that if/else list comprehension