Python中有什么函数而不是VB6中的Val()? [英] What function is there in Python instead of Val() in VB6?
本文介绍了Python中有什么函数而不是VB6中的Val()?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在将一些程序从Visual Basic 6.0转换为Python,而我在VB中被困在一行中。 Visual Basic代码:
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))
对于VB中的函数Chr(),我在Python中使用chr()。对于Val函数,哪个函数在Python中类似?
For the function Chr() in VB I'm using chr() in Python. For the Val function, which function is similar in Python?
推荐答案
请从下面尝试解决方案,因为在Python中没有为Val()构建的等效函数。
http://forums.devshed.com/python-programming-11/python-val-function-resolved-240007.html [ ^ ]
< a href =http://stackoverflow.com/questions/30892233/what-function-is-there-in-python-instead-of-val-in-vb6> http://stackoverflow.com/questions/30892233 / what-function-is-in-python-instead-val-in-vb6 [ ^ ]
Please try solution from below , as there is no in built equivalent fucntion for Val() in Python .
http://forums.devshed.com/python-programming-11/python-val-function-resolved-240007.html[^]
http://stackoverflow.com/questions/30892233/what-function-is-there-in-python-instead-of-val-in-vb6[^]
这篇关于Python中有什么函数而不是VB6中的Val()?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文