Beginner python 3 unicode question

Luuk luuk at invalid.lan
Sat Nov 16 16:10:32 EST 2013


On 16-11-2013 21:57, Laszlo Nagy wrote:
>
>> the error is in one of the lines you did not copy here....
>>
>> because this works without problems:
>> <<BEGIN-of script>>
>> #!/usr/bin/python
>>
> Most probably, your /usr/bin/python program is python version 2, and not
> python version 3
>
> Try the same program with /usr/bin/python3. And also try the interactive
> mode with the same program and I think you will see the same phenomenon.
>

adding some '()' helped:
<<BEGIN-of script>>
#!/usr/bin/python3

import uuid
import base64
print (base64.b32encode(uuid.uuid1().bytes)[:-6].lower())
<<END-of script>>

~/temp> python3 --version
Python 3.3.0




More information about the Python-list mailing list