I have created a .txt file in a Python script I've written, but when trying to open that file, TextEdit always hangs. Am I creating the file incorrectly?
I've tried breaking up my data, writing it to file over a number of files in order to reduce each file size, but that hasn't helped. This is the code I'm using:
dest_file1 = open('/Users/user/Desktop/c_sql_ready_6.txt', 'w')
dest_file1.write(final_record_string_1)
dest_file1.close()
I have also tried opening the write-to file with this code:
dest_file1 = open('/Users/user/Desktop/c_sql_ready_6.txt', mode='w')
I am pulling the data from another file I've opened (using .readlines() ); it is a .csv file, then as I process the data, I add it to a new, empty string, resulting in one long string. I then write that new long string to the above created file.
TextEdit has not problem openning this .csv file, and its the only file I read from (in other words, the single text file I write to is basically the same size as the source file, and TextEdit has no problem with that one).