If you really want it as one pair per line and to create a dict separately use the csv module and forget the tuple:
import csv
with open("tup.txt","w") as f:
csv.writer(f).writerows(mylist)
Output:
computer,1592
student,1113
university,1080
raspberry,1000
science,814
$5,770
pi,688
exam,571
just,544
intelligence,495
solution,475
costs,423
exam:,411
latest,402
pi's,366
be,311
can,268
what,268
way,257
students,238
and to create the dict just call dict on myList:
d = dict(myList)
Output:
{u'be': 311, u'what': 268, u'$5': 770, u'exam': 571, u'just': 544, u'students': 238, u'science': 814, u'university': 1080, u'way': 257, u'solution': 475, u'costs': 423, u"pi's": 366, u'computer': 1592, u'can': 268, u'student': 1113, u'intelligence': 495, u'pi': 688, u'raspberry': 1000, u'exam:': 411, u'latest': 402}
If you essentially want a dict then you can just create and dump a dict using json:
import json
with open("data.json","w") as f:
json.dump(dict(mylist), f)
Which will store your data as:
{"what": 268, "science": 814, "pi's": 366, "can": 268, "be": 311, "exam:": 411, "university": 1080, "costs": 423, "intelligence": 495, "latest": 402, "just": 544, "solution": 475, "$5": 770, "raspberry": 1000, "student": 1113, "way": 257, "computer": 1592, "exam": 571, "students": 238, "pi": 688}
Then to load again:
with open("data.json") as f:
d = json.load(f)
print(d)
Which will give you a dict again:
{'raspberry': 1000, 'exam': 571, 'what': 268, 'be': 311, 'intelligence': 495, 'latest': 402, 'computer': 1592, 'university': 1080, '$5': 770, 'science': 814, 'can': 268, 'costs': 423, 'students': 238, 'solution': 475, 'student': 1113, 'pi': 688, 'exam:': 411, 'just': 544, 'way': 257, "pi's": 366}