Home

7stud schrieb:
> Suppose I write:
>
> f = open("myimg.jpg")
> f.read(10)
>
>
> According to the docs,
> -----------
> read([size])
>
> Read at most size bytes from the file....The bytes are returned as a
> string object.
> ----------
>
> How does python convert a byte to a string?

A string _is_ a sequence of bytes - there is nothing to convert.

Diez

previous
next

Re: Abusing const/mutable with std::set
Re: The Future of Python Threading
Re: advice about `correct' use of decorator
Is there a nicer way to do this?
Re: tempfile.mkstemp and os.fdopen
Fundacja Sloneczko
Fundacja Hobbit
Nasze Dzieci
Akogo
Fundacja Iskierka