Python 3 教程
Python3 內(nèi)置函數(shù)
bytes 函數(shù)返回一個(gè)新的 bytes 對象,該對象是一個(gè) 0 <= x < 256 區(qū)間內(nèi)的整數(shù)不可變序列。它是 bytearray 的不可變版本。
以下是 bytes 的語法:
class bytes([source[, encoding[, errors]]])
返回一個(gè)新的 bytes 對象。
以下展示了使用 bytes 的實(shí)例: