Habe eine frage. Ich habe ein Programm angefangen zu schreiben, aber irgendwie geht das nicht richtig mit utf8
hier der code:
Code: Alles auswählen
#!/usr/bin/python
# -*- coding: utf-8 -*-
# Improtieren der Module
import sys
import cPickle
import time
import os
"""
Name: GetContact
Version: 0.0.1 PreAlpha
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 3
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You dont have a copy of the GNU GPL - dont care about it,
we think you know what GPL means ;)
"""
class Adressbuch(object):
def __init(self):
pass
def main_loop(self):
while True: #Programmschleife welche das menue immer wieder aufruft....
print """ Was wollen sie tun?
(1) Adressbuch Anzeigen
(2) Neuen Kontakt anlegen
(3) Kontaktinformationen bearbeiten
(4) Kontakt löschen
(0) Programm beenden"""
eingabe = int(raw_input("Geben Sie eine Zahl ein!"))
if eingabe == 1:
print "Sie haben 1 gewählt..."
elif eingabe == 2:
print "Sie haben 2 gewählt..."
elif eingabe == 3:
print "Sie haben 3 gewählt..."
elif eingabe == 4:
print "Sie haben 4 gewählt..."
elif eingabe == 0:
exit()
else:
print "Falsche Eingabe."
def eintrag_neu(self):
pass
def anzeigen(self):
pass
def eintrag_entfernen(self):
pass
def kontakt_edit(self):
pass
def kontakt_suche(self):
pass
def _kontakt_(self):
"""
Diese Klasse steht für einen Kontakt.
Hier werden alle informationen zwischengespeichert.
Nachher werden sie mit cPickle in eine Datei gespeichert.
"""
self.kontakt_vorname = ""
self.kontakt_nachname = ""
self.kontakt_land = ""
self.kontakt_ort = ""
self.kontakt_strasse = ""
self.kontakt_hausnummer = ""
self.kontakt_festnetz_nummer = ""
self.kontakt_handy_nummer = ""
self.kontakt_email = ""
self.kontakt_jabber = ""
# Globale Variabeln
name = "Kontaktmanager"
version = "0.0.1 PreAlpha"
line = "-------------------------"
# Willkommensscreen
print line
print "", name, version
print line
if __name__ == "__main__":
Adressbuchlistenobjekt = Adressbuch()
Adressbuchlistenobjekt.main_loop()
else:
print "Dieses Modul ist nicht zum Importieren gedacht"
PS: Wird mein erstes Programm.