0

I would like to convert long into bytes in Python 3.

Following code I'm using in C#:

long time = 7620584977
var a = BitConverter.GetBytes(time).Reverse().ToArray()
// a is [0,0,0,1,198,56,230,224] 

Is there a similar simple code in Python (3)?

Tatranskymedved
  • 4,194
  • 3
  • 21
  • 47

0 Answers0