python - how to change the string with decimal and hyphen into int -


i grabbing ip addresses site , part of result looks this.

192.168.1.1\t12345\t12345\t2013-05-14\t2013-05-14\n192.168.1.1\t98765\t98765\t2013-05-14\t2013-05-14

and of course complete result have lot of ip addresses. i'm trying change particular string int can length. i've tried

length = int(string, 16) 

but it's giving me invalid literal int() base 16 error. how can change int?

if want length of whole string can len(string). if want number of ip addresses, have split \n , length of returned list.

len(string.splitlines()) 

Comments

Popular posts from this blog

c# - DetailsView in ASP.Net - How to add another column on the side/add a control in each row? -

javascript - firefox memory leak -

Trying to import CSV file to a SQL Server database using asp.net and c# - can't find what I'm missing -