編碼:將字符串變成計算機的字節碼
解碼:將計算機的字節碼改成字符串
代碼:
a = 'abcd'
# 編碼:
code = a.encode("UTF-8")
print(code)
# 解碼:
test = code.decode("UTF-8")
print(test)
編碼:將字符串變成計算機的字節碼
解碼:將計算機的字節碼改成字符串
代碼:
a = 'abcd'
# 編碼:
code = a.encode("UTF-8")
print(code)
# 解碼:
test = code.decode("UTF-8")
print(test)
class MetaCls(type): def __new__(cls, *args, **kwargs): print("in MetaCls") # return super(Meta