Hey gang, maybe I’m in over my head…
Correct me please…
someVariable = 1
someVariable is an int. It’s value is 1… correct?
anotherVariable = 'Brian likes his steak rare."
anotherVariable is a string of text. It’s value is “Brian likes his steak rare.”
With that being said…
(0,0,0) is a tuple of 3 ints.
Python knows this. How come when I put a tuple in a dictionary as a value
to a key, Python changes it? It did the same thing to a string but I corrected
it by slicing the [’ and '] off of both ends.
Well when I pickle dump the data, and then pickle load the data at a later time
the tuple is no longer a tuptle, it’s worthless as is.
So it prints like this when I save it --> [[’(0, 0, 0)’]]
It prints likes this when I load it --> [[[’(0, 0, 0)’]]]
If I don’t redefine the color data, and make a chage some where else and
save the data, the same value now looks like this --> [[[[’(255, 255, 255)’]]]]
You can see a pattern I imagine. Evertime the value gets put into an instance
of a dictionary another set of brackets gets slapped on.
But because it has brackets wrapped around it, is it now a string, and no longer a tuple?
Obviously again I’ve messed something up
Thanks,
Steve