Input:
Output error in idle:
Traceback (most recent call last):
File "C:/Python33/pickling 2.py", line 23, in <module>
s = shelve.open("pi ckles2.db")
File "C:\Python33\li b\shelve.py", line 232, in open
return DbfilenameShelf (filename, flag, protocol, writeback)
File "C:\Python33\li b\shelve.py", line 216, in __init__
Shelf.__init__( self, dbm.open(filena me, flag), protocol, writeback)
File "C:\Python33\li b\dbm\__init__. py", line 83, in open
raise error[0]("db type could not be determined")
dbm.error: db type could not be determined
Prints that after outputting everything until after:
print("\nShelvi ng lists.")
I'm very new go easy on me.
Code:
import pickle, shelve
variety = ["sweet", "hot", "dill"]
shape = ["whole", "spear", "chip"]
brand = ["Claussen", "Heinz", "Vlassic"]
f = open("pickles2.db", "wb")
pickle.dump(variety, f)
pickle.dump(shape, f)
pickle.dump(brand, f)
f.close()
f = open("pickles2.db", "rb")
variety = pickle.load(f)
shape = pickle.load(f)
brand = pickle.load(f)
print(variety)
print(shape)
print(brand)
f.close()
print("\nShelving lists.")
s = shelve.open("pickles2.db")
Traceback (most recent call last):
File "C:/Python33/pickling 2.py", line 23, in <module>
s = shelve.open("pi ckles2.db")
File "C:\Python33\li b\shelve.py", line 232, in open
return DbfilenameShelf (filename, flag, protocol, writeback)
File "C:\Python33\li b\shelve.py", line 216, in __init__
Shelf.__init__( self, dbm.open(filena me, flag), protocol, writeback)
File "C:\Python33\li b\dbm\__init__. py", line 83, in open
raise error[0]("db type could not be determined")
dbm.error: db type could not be determined
Prints that after outputting everything until after:
print("\nShelvi ng lists.")
I'm very new go easy on me.
Comment