MCPcopy Create free account
hub / github.com/cppla/ServerStatus / byte_str

Function byte_str

clients/client-psutil.py:399–410  ·  view source on GitHub ↗

bytes to str, str to bytes :param object: :return:

(object)

Source from the content-addressed store, hash-verified

397
398
399def byte_str(object):
400 '''
401 bytes to str, str to bytes
402 :param object:
403 :return:
404 '''
405 if isinstance(object, str):
406 return object.encode(encoding="utf-8")
407 elif isinstance(object, bytes):
408 return bytes.decode(object)
409 else:
410 print(type(object))
411
412if __name__ == '__main__':
413 for argc in sys.argv:

Callers 1

client-psutil.pyFile · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected