Unter http://www.warweg.com/python/ habe ich eine Musterdatei abgestellt, wie sie von HOST-Rechnern kommt. ÄÜÖß sind enthalten. Dies führt teilweise zu Verschiebungen im Satzaufbau. Wie kann ich das vermeiden? MfG Werner Warweg _______________________________________________ python-de maillist - python-de@python.net http://python.net/mailman/listinfo/python-de
Hi Werner,
ÄÜÖß sind enthalten. Dies führt teilweise zu Verschiebungen im Satzaufbau. Wie kann ich das vermeiden?
ich schätze mal deine Textdatei verwendet ein komisches Encoding. Ich kenne mich nur mit denen im Internet üblichen Encodings aus und davon scheint es keines zu sein. Schau' dir einfach mal das Module 'codecs' an und finde 'raus, welches Encoding ihr verwendet. Dann öffnest du die Datei einfach mit: text = codecs.open('file.txt','r','dein_encoding').read() Gruß, Achim _______________________________________________ python-de maillist - python-de@python.net http://python.net/mailman/listinfo/python-de
participants (2)
-
Achim Domma (Procoders)
-
Werner Warweg