On Sat, Dec 12, 2009 at 6:35 PM, Carsten Haese carsten.ha...@gmail.comwrote:
The traceback helpfully shows us that colValue is a 1-tuple whose zeroth
entry, colValue[0], is an actual bona-fide Python Set object. Such
objects aren't indexable, because sets are unordered. That still doesn't
On Sun, Dec 13, 2009 at 12:48 PM, Victor Subervi
victorsube...@gmail.com wrote:
Who said I was expecting a string? I don't know what I'm expecting! I need
to be able to parse this thing, whatever it is. You say it's a Python Set
object. How do I parse it? Googling has been disappointing.
You
Victor Subervi wrote:
On Sat, Dec 12, 2009 at 6:35 PM, Carsten Haese carsten.ha...@gmail.com
mailto:carsten.ha...@gmail.com wrote:
The traceback helpfully shows us that colValue is a 1-tuple whose zeroth
entry, colValue[0], is an actual bona-fide Python Set object. Such
objects
On Sun, Dec 13, 2009 at 11:36 AM, Carsten Haese carsten.ha...@gmail.comwrote:
I don't know what I'm expecting!
That statement is the most succinct summary of the root cause of all
your problems. If you don't know what to expect, how could you possibly
write code that produces what you
On Sun, 13 Dec 2009, Victor Subervi wrote:
On Sun, Dec 13, 2009 at 11:36 AM, Carsten Haese carsten.ha...@gmail.com
wrote:
I don't know what I'm expecting!
That statement is the most succinct summary of the root cause of all
your problems. If you don't know what to expect, how could
On Sun, Dec 13, 2009 at 11:56 AM, Robert P. J. Day rpj...@crashcourse.cawrote:
On Sun, 13 Dec 2009, Victor Subervi wrote:
On Sun, Dec 13, 2009 at 11:36 AM, Carsten Haese carsten.ha...@gmail.com
wrote:
I don't know what I'm expecting!
That statement is the most succinct
On Sun, 13 Dec 2009, Victor Subervi wrote:
On Sun, Dec 13, 2009 at 11:56 AM, Robert P. J. Day rpj...@crashcourse.ca
wrote:
On Sun, 13 Dec 2009, Victor Subervi wrote:
On Sun, Dec 13, 2009 at 11:36 AM, Carsten Haese
carsten.ha...@gmail.com
wrote:
I
Victor Subervi wrote:
I need to get at the individual elements of the set (that which is
between the single quotes).
It's not quite clear what you mean by get at the individual elements,
so I'll just show you a couple of things you can do to a set, and maybe
one of them comes close to what you
On Sun, Dec 13, 2009 at 11:26 AM, Sebastian Bassi
sba...@clubdelarazon.orgwrote:
On Sun, Dec 13, 2009 at 12:48 PM, Victor Subervi
victorsube...@gmail.com wrote:
Who said I was expecting a string? I don't know what I'm expecting! I
need
to be able to parse this thing, whatever it is. You
On Sun, Dec 13, 2009 at 2:10 PM, Carsten Haese carsten.ha...@gmail.com wrote:
from sets import Set
aSet = Set(['Small', 'Extra-small', 'Medium'])
You don't need to import Set since it is built in now:
a=set([1,2,2,3,4,5])
a
set([1, 2, 3, 4, 5])
(I have Python 2.6.2 but I think that this is
On Sun, Dec 13, 2009 at 12:10 PM, Carsten Haese carsten.ha...@gmail.comwrote:
Victor Subervi wrote:
I need to get at the individual elements of the set (that which is
between the single quotes).
It's not quite clear what you mean by get at the individual elements,
so I'll just show you a
On Sun, Dec 13, 2009 at 12:39 PM, Victor Subervi victorsube...@gmail.comwrote:
PS: I have another field that's a datetime with the same problem. How do I
parse and otherwise work with that?
TIA,
V
--
http://mail.python.org/mailman/listinfo/python-list
Victor Subervi wrote:
On Sun, Dec 13, 2009 at 11:26 AM, Sebastian Bassi
sba...@clubdelarazon.org mailto:sba...@clubdelarazon.org wrote:
On Sun, Dec 13, 2009 at 12:48 PM, Victor Subervi
victorsube...@gmail.com mailto:victorsube...@gmail.com wrote:
Who said I was expecting a
On Sun, Dec 13, 2009 at 12:40 PM, Victor Subervi victorsube...@gmail.comwrote:
On Sun, Dec 13, 2009 at 12:39 PM, Victor Subervi
victorsube...@gmail.comwrote:
PS: I have another field that's a datetime with the same problem. How do I
parse and otherwise work with that?
I have yet another
Victor Subervi wrote:
On Sun, Dec 13, 2009 at 12:39 PM, Victor Subervi
victorsube...@gmail.com mailto:victorsube...@gmail.com wrote:
PS: I have another field that's a datetime with the same problem. How do
I parse and otherwise work with that?
Look at the documentation for the datetime
Victor Subervi wrote:
On Sun, Dec 13, 2009 at 12:40 PM, Victor Subervi
victorsube...@gmail.com mailto:victorsube...@gmail.com wrote:
On Sun, Dec 13, 2009 at 12:39 PM, Victor Subervi
victorsube...@gmail.com mailto:victorsube...@gmail.com wrote:
PS: I have another field that's a
Victor Subervi wrote:
On Sun, Dec 13, 2009 at 12:10 PM, Carsten Haese carsten.ha...@gmail.comwrote:
Victor Subervi wrote:
I need to get at the individual elements of the set (that which is
between the single quotes).
It's not quite clear what you mean by get at the individual
Victor Subervi wrote:
Hi;
What type does python consider a MySQL Set??
Let's take a look:
import MySQLdb
conn = MySQLdb.connect(db=carsten, user=blah, passwd=blah)
cur = conn.cursor()
cur.execute(
... create table pizza (
... id integer,
... toppings
On Sat, Dec 12, 2009 at 5:11 PM, Carsten Haese carsten.ha...@gmail.comwrote:
Victor Subervi wrote:
Hi;
What type does python consider a MySQL Set??
Let's take a look:
import MySQLdb
conn = MySQLdb.connect(db=carsten, user=blah, passwd=blah)
cur = conn.cursor()
cur.execute(
...
On Sat, Dec 12, 2009 at 6:07 PM, Victor Subervi victorsube...@gmail.comwrote:
On Sat, Dec 12, 2009 at 5:11 PM, Carsten Haese carsten.ha...@gmail.comwrote:
Victor Subervi wrote:
Hi;
What type does python consider a MySQL Set??
Let's take a look:
import MySQLdb
conn =
Victor Subervi wrote:
Yep, sure does, but it isn't. Again:
if isinstance(colValue[0], (str, int, long, float, long,
complex, unicode, list, buffer, xrange, tuple)):
pass
else:
print 'XXX'
and those strings printed triple-X. It
Victor Subervi wrote:
On Sat, Dec 12, 2009 at 5:11 PM, Carsten Haese carsten.ha...@gmail.com
mailto:carsten.ha...@gmail.com wrote:
Victor Subervi wrote:
Hi;
What type does python consider a MySQL Set??
Let's take a look:
[snip]
Looks like a string to me.
Yep,
Victor Subervi wrote:
PS:
Changed the code to this:
elif col[:3] != 'pic':
if isinstance(colValue[0], (str, int, long, float, long,
complex, unicode, list, buffer, xrange, tuple)):
pass
else:
print 'XXX'
23 matches
Mail list logo