Ohhh ok i got it to work! but why isn't the change
permanent? it is "writing" to the file isn't it.
--- Liam Clarke <[EMAIL PROTECTED]> wrote:
> Hi Ryan,
>
> You're trying to use your file, dictionary.dat like
> a dictionary data
> structure in Python.
> They don't work the same way.
>
> So.
>
Hi Ryan,
You're trying to use your file, dictionary.dat like a dictionary data
structure in Python.
They don't work the same way.
So.
pickle_file = open("dictionary.dat", "r")
dictionary = cPickle.load(pickle_file)
pickle_file.close()
elif choice == "2":
pickle_file = open("dictionary.
Hey, thanks for the help but when i try i get a error
Bad file descripter, here is the code im using
elif choice == "2":
pickle_file = open("dictionary.dat", "a")
sentence = raw_input("Enter the word youd like
to add: ")
if sentence not in pickle_file:
definitio
Hi Ryan,
Technically, you don't.
You haul your dictionary out, as you're doing here -
dictionary = cPickle.load(pickle_file)
And when you're finished, you pickle it again.
Regards,
Liam Clarke
On 3/5/06, ryan luna <[EMAIL PROTECTED]> wrote:
> Hello, this is like my 3rd question today lol whi
Hello, this is like my 3rd question today lol which is
making up for not asking any for months =P, anyways
I have a pickled .dat file named dictionary, maybe
youv guessed this but its a dictionary of the
Alphabet, the program is a translator right now all it
does is translate the Alpabet (its a stu