티스토리 뷰

공부

[Python] binary string to int

seunggabi 승가비 2020. 6. 26. 01:04
>>> int('11111111', 2)
255

https://stackoverflow.com/questions/8928240/convert-base-2-binary-number-string-to-int

 

Convert base-2 binary number string to int

I'd simply like to convert a base-2 binary number string into an int, something like this: >>> '11111111'.fromBinaryToInt() 255 Is there a way to do this in Python?

stackoverflow.com

 

'공부' 카테고리의 다른 글

[Java] /Contents/Home/jre/bin/javac not found  (0) 2020.06.26
[Kibana] filter greater than count  (0) 2020.06.26
[Python] binary string to int  (0) 2020.06.26
[Python] Making a job fail in jenkins  (0) 2020.06.26
[Sh] sleep  (0) 2020.06.26
[Python] regexp split  (1) 2020.06.26
댓글
댓글쓰기 폼