[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: [pygame] how hexcolour arrays works?



Paulo Silva wrote:
Dr0id, thanks! your code resulted as i wanted, but...

::> This 'a = []*8  ' does not what you expect. See documentation.

which documentation? where?



::> a = [0x883746, 0xA88721, 0xBDE87A, 0xEE875F, 0xFE98A1, 0x334836,
0x374838, 0xAAB398]

Is it the only way for defining numeral (float and integer) arrays in python?
What i wanted is:
. define the size of the array before using it - just like 'dim a[8]'
works on sdlBasic, and 'a_st=[""]*8' works so fine with strings on
Python
. being able to put values inside the array when and where i want,
just like a[5]=0x403304


Don't do that. It is hard to edit and error prone.




::> http://www.diveintopython.org/native_data_types/lists.html

It's exactly what i want to avoid... this example is only about
strings (and i'm looking for numerals like integer and float
examples), and are mostly about array concatenation, what i'm really
avoiding now...

Lists don't care what values you put in them, its all the same.

--Noah

Attachment: signature.asc
Description: OpenPGP digital signature