Re: What is the equivalent of chr(x) for bytes in python 3?

2009-12-26 Thread MRAB
Baptiste Lepilleur wrote: Hi, I'm looking for the equivalent of the built-in chr(x) function that would return a bytes type taking an integer as parameter. The easiest way I found to do this is the function below, but there must be some simpler way to do that and I must be overlooking somethi

What is the equivalent of chr(x) for bytes in python 3?

2009-12-26 Thread Baptiste Lepilleur
Hi, I'm looking for the equivalent of the built-in chr(x) function that would return a bytes type taking an integer as parameter. The easiest way I found to do this is the function below, but there must be some simpler way to do that and I must be overlooking something fairly obvious... def byte(