I have a file that contains this binary strings:
00100
11110
10110
10111
How do I convert all the lines to integers?
The out put I would want for example is:
4
30
23
22
I have a file that contains this binary strings:
00100
11110
10110
10111
How do I convert all the lines to integers?
The out put I would want for example is:
4
30
23
22
int('00100', 2)
int('11110', 2)
int('10110', 2)
int('10111', 2)
See Also : Convert base-2 binary number string to int