Encoding questions (continuation)
Νικόλαος Κούρας
nikos.gr33k at gmail.com
Mon Jun 10 09:56:06 EDT 2013
Τη Δευτέρα, 10 Ιουνίου 2013 2:41:07 μ.μ. UTC+3, ο χρήστης Steven D'Aprano έγραψε:
> On Mon, 10 Jun 2013 14:13:00 +0300, Νικόλαος Κούρας wrote:
>
>
>
> > Τη Δευτέρα, 10 Ιουνίου 2013 1:42:25 μ.μ. UTC+3, ο χρήστης Andreas
>
> > Perstinger έγραψε:
>
> >
>
> > > >>> s = b'\xce\xb1'
>
> > >
>
> > > >>> s[0]
>
> > >
>
> > > 206
>
> >
>
> > 's' is a byte object, how can you treat it as a string asking to present
>
> > you its first character?
>
>
>
> That is not treating it as a string, and it does not present the first
>
> character. It presents the first byte, which is a number between 0 and
>
> 255, not a character.
>
>
>
> py> alist = [0xce, 0xb1]
>
> py> alist[0]
>
> 206
To my mind alist[0] should yield '0xce'
> Is that treating alist as a string? No, of course not. Strings are not
>
> the only object that have indexing object[position].
Yes actually it does.
s string is a series of characters.
a list is a series of objects, which can be chars, strings, integers, other data structures.
So doing a_list[0] is similar of doing a_string[00
> > > A byte object is a sequence of bytes (= integer values) and support
> > indexing
Isn't a byte a series of zeros and ones, like 01010101 ?
So why you say bytes are integers since its numbers into a binary system?
perhsp you mean a represantaion of a bye to a decimal value?
> I am not saying this to insult you, or to be rude. But you are obviously
> struggling with the most basic concepts, like what a byte is. You need to
> go back to basics and learn the simple things, and perhaps if it is
> explained to you in your native language, you will understand it better.
>
> I have already provided an example. Many other people have provided
>
> examples. Please read them.
i do read everythign being posted back to me.
> > ps. i tried to post a reply to the thread i opend via thunderbird mail
> > client, but not as a reply to somne other reply but as new mail send to
> > python list.
> > because of that a new thread will be opened. How can i tell thunderbird
> > to reply to the original thread and not start a new one?
> By replying to an email in that thread.
Yes thats obvious.
What is not obvious is how you reply back to a thread by giving extra info when you are not replying to a mail formt tha thread or when you ahve deleted the reply for a member
sending the mail to python-list at python.org will just open anew subject intead of replyign to an opened thread.
More information about the Python-list
mailing list