I'm converting some programs from Visual Basic 6.0 to Python, and I'm stuck in one line in VB.
Visual Basic code:
bAddStart = "100"
bNoOfBytes = "94"
MeterId = 1
Data = Chr(MeterId) + Chr(3) + Chr(Val(bAddStart) \ 256) + Chr(Val(bAddStart) Mod 256) + Chr(0) + Chr(Val(bNoOfBytes))
For the function Chr
in VB I'm using chr()
in Python.
For the Val
function, which is a similar function in Python?
try
int(bNoOfBytes)
e.g:
chr(int("65"))
will returnA
.