D
Dan
I've just begun playing with Python, and so far I like what I see.
It's a very elegant language. But I've found something that's, well,
a bit ugly. Maybe someone can point out to me where I'm wrong.
If you use triple quotes to define a string, then the newlines are
implicitly included. This is a very nice feature. But if you're
inside a function or statement, then you'll want the string to be
positioned along that indentation. And the consequences of this is
that the string will include those indentations.
For example:
def SomeFunction()
if SomeCondition:
MyString =
"""
The quick brown fox
"""
print MyString
The output will be:
The quick brown fox
But what you really want is:
The quick brown fox
The way around it is to write the function thus:
def SomeFunction()
if SomeCondition:
MyString =
"""
The quick brown fox
"""
print MyString
But that's just ugly. It seems to me that the string should be
interpreted with the edge along the indentation line, not from the
start of the line. But that would probably create other problems.
Dan
It's a very elegant language. But I've found something that's, well,
a bit ugly. Maybe someone can point out to me where I'm wrong.
If you use triple quotes to define a string, then the newlines are
implicitly included. This is a very nice feature. But if you're
inside a function or statement, then you'll want the string to be
positioned along that indentation. And the consequences of this is
that the string will include those indentations.
For example:
def SomeFunction()
if SomeCondition:
MyString =
"""
The quick brown fox
"""
print MyString
The output will be:
The quick brown fox
But what you really want is:
The quick brown fox
The way around it is to write the function thus:
def SomeFunction()
if SomeCondition:
MyString =
"""
The quick brown fox
"""
print MyString
But that's just ugly. It seems to me that the string should be
interpreted with the edge along the indentation line, not from the
start of the line. But that would probably create other problems.
Dan