Skip to content Skip to sidebar Skip to footer

Printing A Literal Python String In Octal

For reasons unknown I am the consumer of metadata that needs to be displayed in octal format to be used. I am trying to figure out how to represent it as an octal. Example: x = '\n

Solution 1:

You can't; that representation is lost. If you want to output "\022" then you need to either process it yourself or you need to store "\\022" instead.


Post a Comment for "Printing A Literal Python String In Octal"