Hallo,

replace liefert einen neuen String zurück (http://docs.python.org/library/stdtypes.html#str.replace). Deswegen kann man ihn im debugger sehen, aber der Wert geht verloren.

Gruß,
Chris

2011/7/1 Wagner, Frank <F.Wagner@wika.de>

Hallo,

 

ich möchte in einem String den Dezimalpunkt durch ein Komma ersetzen, leider hat folgender Code keinen Effekt:

 

anzahl = len(werteliste)

for i in range(anzahl-1):

    werteliste[i].replace(".", ",", 1)  # Punkt durch Komma ersetzen zur

 

Sehe ich mir das im Debugger an so sehen die einzelnen Listenelemente wie folgt aus:

 

werteliste[i]   '+3.00305873E+00'

 

Wenn ich darüber steppe bleibt der Punkt allerdings erhalten.

Ich hab keine Ahnung was ich übersehen habe aber vielleicht kann mir einer auf die Sprünge helfen.

 

Schon jetzt recht herzlichen Dank

 

Mit freundlichen Grüßen / Kind regards

 

Frank Wagner

Entwicklung - Prozesstransmitter

 

 

WIKA

Alexander Wiegand SE & Co. KG

Alexander Wiegand-Straße 30

63911 Klingenberg am Main

 

Tel: 09372-132-8995

Fax: 09372-132-9976

E-mail: f.wagner@wika.de

 

--

--

 P   Bevor Sie diese E-Mail ausdrucken, überlegen Sie bitte, ob dies wirklich erforderlich ist. Please think before you print.

--

WIKA Alexander Wiegand SE & Co. KG

Alexander-Wiegand-Straße 30 - 63911 Klingenberg - Germany

Kommanditgesellschaft: Sitz Klingenberg - Amtsgericht Aschaffenburg HRA 1819

Komplementärin: WIKA Verwaltungs SE & Co. KG - Sitz Klingenberg -

Amtsgericht Aschaffenburg HRA 4685

Komplementärin: WIKA International SE - Sitz Klingenberg -

Amtsgericht Aschaffenburg HRB 10505

Vorstand: Alexander Wiegand

Vorsitzender des Aufsichtsrats: Dr. Max Egli

Telefon: (09372) 132-0

Internet: www.wika.com

--

The information contained in this E-Mail and any attached files are strictly confidential and may be subject to legal privilege. If you are not the intended recipient, his representative or the person responsible for delivering the message to the intended recipient, be advised that you have received this message in error and that any dissemination, copying or use of this message or attachment is strictly forbidden, as is the disclosure of the information therein. If you have received this E-Mail in error, please notify us immediately by E-Mail or telephone and delete this message and all its attachments subsequently. All reasonable precautions have been taken to ensure no viruses are present in this E-Mail.

_______________________________________________
python-de maillist  -  python-de@python.org
http://mail.python.org/mailman/listinfo/python-de