A naive example (that doesn't load the file into memory like Sven's):
with open('file', 'r') as r:
with open('file1', 'w') as f:
for line in r:
if line == 'string pattern\n':
break
f.write(line)
with open('file2', 'w') as f:
for line in r:
f.write(line)
This assumes that 'string pattern'
occurs once in the input file.
If the pattern isn't a fixed string, you can use the re module.