Just like any other byte string: b'\0'
and b'^'
.
Example:
>>> # Using strings
>>> s="test"
>>> s.ljust(6, '^')
'test^^'
>>>
>>> # Using bytes
>>> s = b'test' # note the `b` prefix
>>> s.ljust(6, b'^') # need `b` prefix
b'test^^'
More Related Contents:
- How to match a string to pattern “Foo-Bar”, where Bar can be any element of a list? [closed]
- how to use a while loop in my python code
- python 3.2 if-else
- Why Python 3.6.1 throws AttributeError: module ‘enum’ has no attribute ‘IntFlag’?
- “Unicode Error “unicodeescape” codec can’t decode bytes… Cannot open text files in Python 3 [duplicate]
- Calling filter returns [duplicate]
- What is this odd colon behavior doing?
- How can I suppress the newline after a print statement?
- ValueError: invalid literal for int () with base 10
- How to know/change current directory in Python shell?
- Why print in Python doesn’t pause when using sleep in a loop?
- TypeError: only integer scalar arrays can be converted to a scalar index with 1D numpy indices array
- Unpack dictionary from Pandas Column
- Backwards-compatible input calls in Python
- How to get Windows short file name in python?
- How to bind several key presses together in turtle graphics?
- __init__() missing 1 required positional argument
- What does the “yield” keyword do in Python?
- Class (Static) variables and methods in Python
- Why do I get a `NameError` (or `UnboundLocalError`) from using a named exception after the `except` block?
- Python 3 gives wrong output when dividing two large numbers?
- tkinter program compiles with cx_Freeze but program will not launch
- not all arguments converted during string formatting.. NO % variables
- How to set Python3.5.2 as default Python version on CentOS?
- how to get text from within a tag, but ignore other child tags
- Building Python 3.7.1 – SSL module failed
- How to redirect from a view to another view In Django
- Python: How to read and load an excel file from AWS S3?
- What is the type hint for a (any) python module?
- How to convert only numbers in a mixed list into float