Wenn du dir nicht sicher bist, in welchem der anderen Foren du die Frage stellen sollst, dann bist du hier im Forum für allgemeine Fragen sicher richtig.
Masaru hat geschrieben:... wenn Du nochmal sagen kannst "wo" das steht, klar gerne warum nicht.
Da %-Formatting in Python 3 deprecated wird, bleibt das nur als logischer schluss uebrig
Whats new in Python 3.0 hat geschrieben:PEP 3101: Advanced String Formatting. Note: the 2.6 description mentions the format() method for both 8-bit and Unicode strings. In 3.0, only the str type (text strings with Unicode support) supports this method; the bytes type does not. The plan is to eventually make this the only API for string formatting, and to start deprecating the % operator in Python 3.1
cofi hat geschrieben:Da %-Formatting in Python 3 deprecated wird, bleibt das nur als logischer schluss uebrig
Ah, wusste ich noch gar nicht, danke .
So ganz steht es Deinem Zitat nach ja aber momentan noch nicht fest cofi: "...The plan is to eventually make this the only API for string formatting, and to start deprecating the % operator in Python 3.1 ..."
Ich plane auch meinen Keller bis Januar aufzuräumen ... das leider schon seit so an die 3 Jahren *pfeif*.
In [23]: kennwort = "hallo"
In [24]: c = re.compile("((@.*){(%s),)" % re.escape(kennwort))
In [25]: c.match("@lalala{hallo,").groups()
Out[25]: ('@lalala{hallo,', '@lalala', 'hallo')
Edit: mit format geht's natürlich auch Ich habe aber gerade nur Python25 im Angebot