1dictionary = {'someKey' : 'someValue'}
2file_path = 'somePathToFile/someFileName.py'
3with open(file_path, 'w') as output_file:
4 print(dictionary, file=output_file)
1dict = {'Python' : '.py', 'C++' : '.cpp', 'Java' : '.java'}
2f = open("dict.txt","w")
3f.write( str(dict) )
4f.close()