I am doing files with dictionaries and csv library and stuff, then I decided to work without csv library and the files worked great but when I decided to add for loops they don't work the first file 'some_file_1.txt' was created but empty and the second file 'some_file_2.txt' was just not even created... the error only happens with the for loop...
object_file_handler = open('some_file_1.txt', 'w')
for c in range(1,10+1):
object_file_handler.write('hello world ! ',c,' \n ')
object_file_handler.close()
with open('some_file_2.txt', 'w') as object_file_handler:
for c in range(1,20+1):
object_file_handler.write('I LOVE MUSIC !\n',c)