Created
September 3, 2012 08:36
-
-
Save poliarush/3607917 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys, os | |
def main(): | |
try: | |
f1 = open('ff1.txt') | |
f2 = open('ff2.txt') | |
f3 = open('ff3.txt') | |
except IOError, e: | |
print "file open error", e | |
sys.exit(1) | |
l = [] | |
for line in f1.readlines(): | |
l.append(line) | |
l.append('\n') | |
for line in f2.readlines(): | |
l.append(line) | |
l.append('\n') | |
for line in f3.readlines(): | |
l.append(line) | |
print l | |
f4 = open('foo.txt', 'w') | |
for line in l: | |
f4.writelines(line) | |
print os.getcwd() + '\\'+ f4.name | |
if __name__ == '__main__': | |
main() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment