I\'m using python 3.4 and I\'m trying to write a list of names to a text file. The list is as follows:
my_list = [\'Dejan Živković\',\'Gregg Berhalter\',\'James
try this:
>>> my_list = ['Dejan Živković','Gregg Berhalter','James Stevens','Mike Windischmann' ,'Gunnar Heiðar Þorvaldsson'] >>> f = open("/Users/.../Desktop/Name_Python.txt", "w") >>> for x in my_list: ... f.write("{}\n".format(x)) ... >>> f.close()