2013-01-21 71 views
2

通常存在如何將字符串轉換爲數字在python將字符串轉換到短

int x = Integer.parseInt(a, 2); //java 
x = int(a,2) # python 

Java和Python之間的平行的,但它似乎並不爲short

short x = Short.parseShort(a, 2); //java 
x = short(a,2) # does not work in python 

有誰工作知道如何縮短工作時間?

回答