import sys
parts = 3
filename = "file.txt"
name, ext = filename.split('.')
data = [line for line in open(filename, "rb").read().split("\n")]
for n, part in enumerate(zip(*[iter(data)] * parts)):
f = open('%s_part_%s.%s' % (name, n, ext), 'w')
f.write("\n".join(part));
f.close()
aW1wb3J0IHN5cwoKcGFydHMgPSAzCmZpbGVuYW1lID0gImZpbGUudHh0IgpuYW1lLCBleHQgPSBmaWxlbmFtZS5zcGxpdCgnLicpCgpkYXRhID0gW2xpbmUgZm9yIGxpbmUgaW4gb3BlbihmaWxlbmFtZSwgInJiIikucmVhZCgpLnNwbGl0KCJcbiIpXQoKZm9yIG4sIHBhcnQgaW4gZW51bWVyYXRlKHppcCgqW2l0ZXIoZGF0YSldICogcGFydHMpKToKCWYgPSBvcGVuKCclc19wYXJ0XyVzLiVzJyAlIChuYW1lLCBuLCBleHQpLCAndycpCglmLndyaXRlKCJcbiIuam9pbihwYXJ0KSk7CglmLmNsb3NlKCk=