Print next characters in line Python -


i looking make simple program find character , print next 10 characters in line. have been able make print out whole line , rest of line useless. have now.

f = open("active notship.txt", "r") searchlines = f.readlines() f.close() i, line in enumerate(searchlines):     if "p-" in line:         print line 

kevin right. did.

f = open("active notship.txt", "r") searchlines = f.readlines() f.close() i, line in enumerate(searchlines):     if "p-" in line:         print line[3:13] 

Comments

Popular posts from this blog

javascript - jQuery: Add class depending on URL in the best way -

caching - How to check if a url path exists in the service worker cache -

Redirect to a HTTPS version using .htaccess -