Feb-15-2019, 02:21 PM
Hi all,
I am new to Python and i am learning it with a book trying all the exemple there.
Now i use the first time the module pickle, and tehre was an example to something simple into a file on my PC. the code was the following :
(lp0
(S'Tim'
p1
S'123'
p2
tp3
a(S'Jenny'
i also tried a simple string (tel = 'abc'), same result.
What is wrong in this code ?
thanks in advance
I am new to Python and i am learning it with a book trying all the exemple there.
Now i use the first time the module pickle, and tehre was an example to something simple into a file on my PC. the code was the following :
tel = [('Tim','123'),('Jenny','456'),('Max','789')] import pickle data = file('myfile.txt','w') pickle.dump(tel,data) data.close()the text file was generated,but with some strage random letters/numbers, this is part of the result :
(lp0
(S'Tim'
p1
S'123'
p2
tp3
a(S'Jenny'
i also tried a simple string (tel = 'abc'), same result.
What is wrong in this code ?
thanks in advance