Wednesday 15 January 2014

python - Find / Slicing Method issue -


I was trying to find numbers to extract the numbers at the end of the line and use the string slicing method. But I get this mismatch error because I have come back with 18 position, but what I've read and researched this situation is 18. Am I missing something here?

  str = ('X-DSPAM-Confidence: 0.8475') atpos = str.find (':') print atpos sppos = str.find ('', atpos) print sppos host = Print Host  

You can use < Code> string.split method should use specific state: delimiter,

  _str = 'x-dspam-trust: 0.8475' host = Float (_str.split (':') [1]) Print (host)  

No comments:

Post a Comment