I have this c# app that Im trying to cooperate with a app written in python. The c# app send simple commands to the python app, for instance my c# app is sending the following:
[Flags]
public enum GameRobotCommands
{
reset = 0x0,
turncenter = 0x1,
turnright = 0x2,
turnleft = 0x4,
standstill = 0x8,
moveforward = 0x10,
movebackward = 0x20,
utility1 = 0x40,
utility2 = 0x80
}
I'm doing this over TCP and got the TCP up and running, but can I plainly do this in Python to check flags:
if (self.data &= 0x2) == 0x2:
#make the robot turn right code
Is there a way in python I can define the same enums that I have in c# (for higher code readability)?