On 11/11/2015 08:21 PM, Michael Torrie wrote:
> On 11/11/2015 08:04 PM, fl wrote:
>> Hi,
>>
>> I am learning python. I see a previous post has such code:
>>
>>
>>
>>
>>
>>>>> data = '"binääridataa"\n'.encode('utf-8')
>>>>> f = open('roska.txt', 'wb')
>>>>> f.write(data)
>>17
>>
On 11/11/2015 08:04 PM, fl wrote:
> Hi,
>
> I am learning python. I see a previous post has such code:
>
>
>
>
>
>>>> data = '"binääridataa"\n'.encode('utf-8')
>>>> f = open('roska.txt', 'wb')
>>>> f.write(data)
>17
>>>> f.close()
>
> The .encode methods produced a
Hi,
I am learning python. I see a previous post has such code:
>>> data = '"binääridataa"\n'.encode('utf-8')
>>> f = open('roska.txt', 'wb')
>>> f.write(data)
17
>>> f.close()
The .encode methods produced a bytestring, which Python likes to display
as ASCII characters