Re: Specify string with uniform indentation ignored

2006-09-14 Thread tobiah
That would be it. Thanks. >> Is there a built in way to do this? I don't much >> care for: >> >> string = "function otherlang(){" >> string += " doit()" >> string += "}" > > textwrap.dedent ought to do exactly what you want. > > --Sam > -- Posted via a free Usenet account

Re: Specify string with uniform indentation ignored

2006-09-14 Thread Sam Pointon
tobiah wrote: > 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

Re: Specify string with uniform indentation ignored

2006-09-14 Thread [EMAIL PROTECTED]
tobiah wrote: > Is there a built in way to do this? I don't much > care for: > > string = "function otherlang(){" > string += " doit()" > string += "}" That can be somewhat simplified to: string = "function otherlang(){"\ "doit()"\ "}" It's not exactly

Specify string with uniform indentation ignored

2006-09-14 Thread tobiah
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() }