[Tutor] sensing EOF in Python 3.1

2011-11-25 Thread Cranky Frankie
From: Steven D'Aprano wrote: <> Right, thanks. <> I want to include this info in my presentation because it shows how data structures can be externalized. <> Still though, that is important. < Sarcasm aside, what else could "import pickle" mean other than import > the pickle module?>> I wa

Re: [Tutor] sensing EOF in Python 3.1

2011-11-23 Thread Steven D'Aprano
Cranky Frankie wrote: From: Peter Otten <__pete...@web.de> wrote: snip <> Thanks Peter, that was it. I was treating pickle like standard file i/o when it's not that at all. I don't understand what you mean by this. Pickle does standard file I/O in the same way that opening a JPEG in an image

Re: [Tutor] sensing EOF in Python 3.1

2011-11-23 Thread Steven D'Aprano
Cranky Frankie wrote: I'm reading in a pickled file. The program works but I'm having trouble sensing end of file. Here's the program: [...] Traceback (most recent call last): File "D:\MyDocs\Python\pickle_in.py", line 21, in read_file = pickle.load(pickle_file)# read the next re

Re: [Tutor] sensing EOF in Python 3.1

2011-11-23 Thread Wayne Werner
On Wed, Nov 23, 2011 at 12:03 PM, Cranky Frankie wrote: > [...] > The reason why I'm "pickling" is I'm trying to include information on > Python data structures in the presentaton I'm preparing. [...] > In your context why not just use modules? # data.py Qb_dict = {"Montana": ["Joe", "Montana"

[Tutor] sensing EOF in Python 3.1

2011-11-23 Thread Cranky Frankie
From: Peter Otten <__pete...@web.de> wrote: snip <> Thanks Peter, that was it. I was treating pickle like standard file i/o when it's not that at all. The reason why I'm "pickling" is I'm trying to include information on Python data structures in the presentaton I'm preparing. Here are the two p

Re: [Tutor] sensing EOF in Python 3.1

2011-11-23 Thread Peter Otten
Cranky Frankie wrote: > I'm reading in a pickled file. The program works but I'm having > trouble sensing end of file. Here's the program: > > # > # pickle_in.py > # program to read in a pickled file > # > # Frank L. Palmeri > # > > import pickle # import the pi

[Tutor] sensing EOF in Python 3.1

2011-11-23 Thread Cranky Frankie
I'm reading in a pickled file. The program works but I'm having trouble sensing end of file. Here's the program: # # pickle_in.py # program to read in a pickled file # # Frank L. Palmeri # import pickle # import the pickle module pickle_file = open("d:/Work/pickl