strings in Python (newbie)

Richard Brodie R.Brodie at rl.ac.uk
Wed Mar 12 09:53:34 EST 2003


"Irmen de Jong" <irmen at -NOSPAM-REMOVETHIS-xs4all.nl> wrote in message
news:3e6f44bc$0$49098$e4fe514c at news.xs4all.nl...

>zif wrote:
>> What would be in Python an equivalent to the following C language strings

> Technically, there is no Python equivalent because Python has no unsigned char
> datatype. However, you could perhaps use the Pythonic
>
> Sconnection = [ 0 ] * 56
> EstabSession = [ 8, 0, 1, 0, 0, 0, 0, 0,
> ...      0, 0, 0, 0, 0, 0, 0, 0 ]
>
> This might do for your purpose depending on the rest of the code.

It's not easy to figure out the best way with such a small snippet.
One really needs to start from 'what operations do I want to do
on this data'. The array module might be of use but it's hard to tell.







More information about the Python-list mailing list