Searching a window of text in Python: Revision history

Diff selection: Mark the radio buttons of the revisions to compare and hit enter or the button at the bottom.
Legend: (cur) = difference with latest revision, (prev) = difference with preceding revision, m = minor edit.

11 March 2014

  • curprev 19:2319:23, 11 March 2014Michael Murtaugh talk contribs 953 bytes +953 Created page with "<source lang="python"> s = "state" f = open("machiavelli_pg1232.txt") lines = f.readlines() numlines = len(lines) # PASS 1: Search the text in "windows" of 5 lines # If the k..."