0
Sözlük bir dosyaya depolamaya çalışıyorum.Neden her zaman bu cPickle hatasını alıyorum?
Bu benim kod parçasıdır:
Accounts={}
if username not in Accounts:
Accounts[username]=password
database=open("my_mail_database", "w")
pickle.dump(Accounts, database)
database.close()
Ve hep bu hatayı alıyorum:
Traceback (most recent call last):
File "C:\Python34\lib\tkinter\__init__.py", line 1538, in __call__
return self.func(*args)
File "C:\Python34\python 3.4\my_gmail2.pyw", line 51, in submit_account
pickle.dump(Accounts, database)
TypeError: must be str, not bytes
birisi bana söyleyebilir whats my koduyla sorun?
http://stackoverflow.com/questions/13906623/using-pickle-dump-typeerror-must-be-str- wb dosyayı açmak zorunda değil-bayt – zezollo