Re: [Tutor] pickle.load() all dict

2010-05-16 Thread Yutao
Thank you Jan. you are right . an exception whitout a reason not conducive to pragramming. ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] updating python on a mac

2010-05-16 Thread Alan Gauld
"Karl Jansson" wrote I downloaded python 3.1.2 for the mac, and I don't know how to make it so that when I type "python" in the terminal that I get python 3.1.2 instead of 2.5.1, which came with my mac. I haven't done this personally so I can only guess but... /Applications/Python\ 3.1/U

[Tutor] updating python on a mac

2010-05-16 Thread Karl Jansson
I downloaded python 3.1.2 for the mac, and I don't know how to make it so that when I type "python" in the terminal that I get python 3.1.2 instead of 2.5.1, which came with my mac. In the instructions, it says to "update shell profile" but when I do that I get the following message, and no

Re: [Tutor] pickle.load() all dict

2010-05-16 Thread Knacktus
Am 16.05.2010 14:45, schrieb Yutao Deng: LOL, try...except is a good idea. i fix it lick this: with open("data2.pickle","rb") as file_stream: c = 0 while True: try: i = cPickle.load(file_stream) print i c += 1 except:

Re: [Tutor] pickle.load() all dict

2010-05-16 Thread Yutao Deng
LOL, try...except is a good idea. i fix it lick this: with open("data2.pickle","rb") as file_stream: c = 0 while True: try: i = cPickle.load(file_stream) print i c += 1 except: print "Numer of pickled objects is

Re: [Tutor] pickle.load() all dict

2010-05-16 Thread Knacktus
Am 16.05.2010 09:10, schrieb Yutao Deng: Hi all: I'm trying to learn to use Python wrote a applet to record every day doing. and i use the pickle pickle.dump something to file no problem i think. but pickle.load whith a problem. can not load all dict do my way that what i pickle.dump(). My

[Tutor] pickle.load() all dict

2010-05-16 Thread Yutao Deng
Hi all: I'm trying to learn to use Python wrote a applet to record every day doing. and i use the pickle pickle.dump something to file no problem i think. but pickle.load whith a problem. can not load all dict do my way that what i pickle.dump(). My code: import cPickle as pickle pickle_file