pickle: IndexError: list index out of range
Hallo python-Forum Als Anf{nger im Python werde ich offenbar gleich mit einem Kapazit{tsproblem von Python konfrontiert? Oder ist es nur ein Programmierfehler? Oder ein Fehler in den Daten? Vielen Dank f}r Tips Philipp Mein Skript: #! /usr/bin/python import pickle f=open('/home/eigeneDaten/ORD/hausapo/ZVOOe_10_2007.txt','r') print f x = pickle.load(f) Python-Meldungen: $ python test.py <open file '/home/eigeneDaten/ORD/hausapo/ZVOOe_10_2007.txt', mode 'r' at 0xb7e95e30> Traceback (most recent call last): File "test.py", line 7, in ? x = pickle.load(f) File "/usr/local/lib/python2.4/pickle.py", line 1390, in load return Unpickler(file).load() File "/usr/local/lib/python2.4/pickle.py", line 872, in load dispatch[key](self) File "/usr/local/lib/python2.4/pickle.py", line 1167, in load_dup self.append(self.stack[-1]) IndexError: list index out of range
--On 26. September 2007 19:01:01 +0200 Philipp Walderdorff <ph.walderdorff@gmx.at> wrote:
Hallo python-Forum
Als Anf{nger im Python werde ich offenbar gleich mit einem Kapazit{tsproblem von Python konfrontiert? Oder ist es nur ein Programmierfehler? Oder ein Fehler in den Daten?
Vielen Dank f}r Tips Philipp
Mein Skript: # ! /usr/bin/python import pickle f=open('/home/eigeneDaten/ORD/hausapo/ZVOOe_10_2007.txt','r') print f x = pickle.load(f)
Du versuchst eine Textdatei mit dem Pickle-Modul zu lesen? Das macht absolut keinen Sinn...wieso das Pickle Modul? Was versprichst Du Dir davon? Dateien werden zum Lesen/Schreiben mit open(...) geöffnet. -aj
Philipp Walderdorff schrieb:
Hallo python-Forum
Als Anf{nger im Python werde ich offenbar gleich mit einem Kapazit{tsproblem von Python konfrontiert? Oder ist es nur ein Programmierfehler? Oder ein Fehler in den Daten?
Vielen Dank f}r Tips Philipp
Mein Skript: #! /usr/bin/python import pickle f=open('/home/eigeneDaten/ORD/hausapo/ZVOOe_10_2007.txt','r') print f x = pickle.load(f)
Python-Meldungen: $ python test.py <open file '/home/eigeneDaten/ORD/hausapo/ZVOOe_10_2007.txt', mode 'r' at 0xb7e95e30> Traceback (most recent call last): File "test.py", line 7, in ? x = pickle.load(f) File "/usr/local/lib/python2.4/pickle.py", line 1390, in load return Unpickler(file).load() File "/usr/local/lib/python2.4/pickle.py", line 872, in load dispatch[key](self) File "/usr/local/lib/python2.4/pickle.py", line 1167, in load_dup self.append(self.stack[-1]) IndexError: list index out of range
_______________________________________________ python-de maillist - python-de@python.net http://python.net/mailman/listinfo/python-de
Philipp Walderdorff schrieb:
Hallo python-Forum
Als Anf{nger im Python werde ich offenbar gleich mit einem Kapazit{tsproblem von Python konfrontiert? Oder ist es nur ein Programmierfehler? Oder ein Fehler in den Daten?
Vielen Dank f}r Tips Philipp
Mein Skript: #! /usr/bin/python import pickle f=open('/home/eigeneDaten/ORD/hausapo/ZVOOe_10_2007.txt','r') print f x = pickle.load(f)
Python-Meldungen: $ python test.py <open file '/home/eigeneDaten/ORD/hausapo/ZVOOe_10_2007.txt', mode 'r' at 0xb7e95e30> Traceback (most recent call last): File "test.py", line 7, in ? x = pickle.load(f) File "/usr/local/lib/python2.4/pickle.py", line 1390, in load return Unpickler(file).load() File "/usr/local/lib/python2.4/pickle.py", line 872, in load dispatch[key](self) File "/usr/local/lib/python2.4/pickle.py", line 1167, in load_dup self.append(self.stack[-1]) IndexError: list index out of range
_______________________________________________ python-de maillist - python-de@python.net http://python.net/mailman/listinfo/python-de
Hallo, Die Datei "ZVOOe_10_2007.txt" die du per pickel laden willst muss im richtigen Format vorliegen. Hast du die Datei also schon vorher mit pickle.dump() geschrieben? Gruß Michael
Am Mittwoch, 26. September 2007 19:01 schrieb Philipp Walderdorff:
Hallo python-Forum
Als Anf{nger im Python werde ich offenbar gleich mit einem Kapazit{tsproblem von Python konfrontiert? Oder ist es nur ein Programmierfehler? Oder ein Fehler in den Daten?
OK, habe es gefunden: csv -- CSV File Reading and Writing d}rfte die richtige L|sung sein. Dann muss ich mich wohl dahinein diggern. Danke f}r Eure Antworten
participants (3)
-
Andreas Jung
-
Michael Schneider
-
Philipp Walderdorff