Click here to Skip to main content
15,037,388 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I'm converting some programs from Visual Basic 6.0 to Python, and I'm stuck in one line in VB. Visual Basic code:

VB
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 function is similar in Python?
Posted

1 solution

   
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)




CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900