I actually believe this is working properly now.
I renamed the script to match the class name: SwapHeaders.py.
Please try it and see if the results are correct.
You can call it from another file like:
I renamed the script to match the class name: SwapHeaders.py.
Please try it and see if the results are correct.
You can call it from another file like:
import SwapHeaders def testit(file1name, file2name, outfilename): sh = SwapHeaders.SwapHeaders(origfile=file1name, headerfile=file2name, outfile=outfilename) sh.make_new_file() sh.close_files() if __name__ == '__main__': testit(file1name='File1.txt', file2name='File2.txt', outfilename='Newfile.txt')Remember, files need to be in data directory (sub-directory of program directory) and make backups first