does anyone know how to have IDLE or Ipython display a string with line breaks as multiline text in the display rather than a big string wrapped around with '\n's?

Instead of

return false;\n    }\n\n    function validPeriod() {\n      for (var i = 0; i < periods.length; i++) {\n

can I have it display:

return false;
}

function validPeriod() {
for (var i = 0; i < periods.length; i++) {

In Python use:

s = """return false;
}

function validPeriod() {
for (var i = 0; i < periods.length; i++) {
"""

# test it
print s

Thanks so much!

Is there a similar method to view an array with many rows in the same way?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.