Specify string with uniform indentation ignored

tobiah st at tobiah.org
Thu Sep 14 17:09:05 EDT 2006


Like a docstring, I would like to specify a string such as:

def thing:
	
	string = """
		function otherlang(){
			doit()
		}
	"""

And have the string end up actually being defined as:

"""
function otherlang(){
	doit()
}
"""

Is there a built in way to do this?  I don't much
care for:

	string = "function otherlang(){"
	string += "	doit()"
	string += "}"

Thanks,

Tobiah

-- 
Posted via a free Usenet account from http://www.teranews.com




More information about the Python-list mailing list