How can I print the raw unicode in python?

novice3

I am novice in Python, so maybe I can't express it well...

I got a string '\xb9\xfe'

I want it print in this very fashion '\xb9\xfe', not converting to a Chinese character '哈'.

What is the proper way to do it?

Martijn Pieters

Use a raw string literal instead:

r'\xb9\xfe'

or print the output of repr() of your string:

print(repr('\xb9\xfe'))

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

How can I print unicode symbols within a certain range?

From Dev

How can I print the decimal representation of a unicode string?

From Dev

Python: How can I print bytes?

From Dev

How can I get raw USB keyboard data with Python?

From Dev

How can I print this?

From Dev

How can I convert a unicode string into string literals in Python 2.7?

From Dev

How can I convert a unicode string into string literals in Python 2.7?

From Dev

How can I add an item with unicode characters to a QComboBox in python?

From Dev

How I can covert it to unicode

From Dev

Python 3 and Unicode - How do I print newlines (general problems understanding this)

From Dev

Why is print so slow in Python 3.3 and how can I fix it?

From Dev

How can I print a long line in realtime in python?

From Java

How can I print variable and string on same line in Python?

From Dev

How can I print [] without string in Python in YAML file

From Dev

How can I print a single row element in Python DictReader

From Dev

How can I make the new python accept print without parentheses?

From Dev

How can i print this in python using rows and cols?

From Dev

How can I print email address using Selenium Python

From Dev

How can I print a one dimensional array as grid in Python?

From Dev

Why is print so slow in Python 3.3 and how can I fix it?

From Dev

How can I literally print out an escape sequence in python?

From Dev

How can I print a complex dictionary data type in Python?

From Dev

How can I make the new python accept print without parentheses?

From Dev

How can I print [] without string in Python in YAML file

From Dev

How can i print and return a value from a function in python?

From Dev

How Can I print Python output at runtime in PHP

From Dev

How can I print to console after button press?(Python 3.5)

From Dev

How can I print data in multi dimensional array in Python

From Dev

How can i insert 2 for loops into print function in python

Related Related

  1. 1

    How can I print unicode symbols within a certain range?

  2. 2

    How can I print the decimal representation of a unicode string?

  3. 3

    Python: How can I print bytes?

  4. 4

    How can I get raw USB keyboard data with Python?

  5. 5

    How can I print this?

  6. 6

    How can I convert a unicode string into string literals in Python 2.7?

  7. 7

    How can I convert a unicode string into string literals in Python 2.7?

  8. 8

    How can I add an item with unicode characters to a QComboBox in python?

  9. 9

    How I can covert it to unicode

  10. 10

    Python 3 and Unicode - How do I print newlines (general problems understanding this)

  11. 11

    Why is print so slow in Python 3.3 and how can I fix it?

  12. 12

    How can I print a long line in realtime in python?

  13. 13

    How can I print variable and string on same line in Python?

  14. 14

    How can I print [] without string in Python in YAML file

  15. 15

    How can I print a single row element in Python DictReader

  16. 16

    How can I make the new python accept print without parentheses?

  17. 17

    How can i print this in python using rows and cols?

  18. 18

    How can I print email address using Selenium Python

  19. 19

    How can I print a one dimensional array as grid in Python?

  20. 20

    Why is print so slow in Python 3.3 and how can I fix it?

  21. 21

    How can I literally print out an escape sequence in python?

  22. 22

    How can I print a complex dictionary data type in Python?

  23. 23

    How can I make the new python accept print without parentheses?

  24. 24

    How can I print [] without string in Python in YAML file

  25. 25

    How can i print and return a value from a function in python?

  26. 26

    How Can I print Python output at runtime in PHP

  27. 27

    How can I print to console after button press?(Python 3.5)

  28. 28

    How can I print data in multi dimensional array in Python

  29. 29

    How can i insert 2 for loops into print function in python

HotTag

Archive