How to read only number from a specific line using python script -


how read number specific line using python script example

"1009 run test jobs" here should read number "1009" instead of "1009 run test jobs"

a simple regexp should do:

import re match = re.match(r"(\d+)", "1009 run test jobs") if match:     number = match.group() 

https://docs.python.org/3/library/re.html


Comments

Popular posts from this blog

PHP while loop dynamic rowspan -

timer - Java TimerTask cancel -

android - How to read a column value in parse.com without accessing an object or a pointer -