"Harald Kirsch" <kirschh at lionbioscience.com> wrote in message news:yv2bspmba7b.fsf at lionsp093.lion-ag.de... > > Do I understand this correctly? > > >>> x='\\\\s' > >>> x > '\\\\s' > >>> len(x) > 3 > > After assignment x contains a string with 3 characters, in particular > 2 backslashes and an `s'. Typing x and <RETURN> gives me a > representation of the value of x in a way that it could be parsed > again into the true value of x. Right? > > Now continuing the example: > > >>> eval('"'+x+'"') > '\\s' > >>> print eval('"'+x+'"') > \s > >>> print len(eval('"'+x+'"')) > 2 > > This, in effect, runs the expression "\\s" which internally denotes a > string with two characters, namely a backslash and an `s'. > Far more correctly than many, I should say. regards STeve
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4