Re: FORTRAN like formatting

2005-07-09 Thread beliavsky
Dennis Lee Bieber wrote: > > On 7/8/05, Einstein, Daniel R <[EMAIL PROTECTED]> wrote: > > > > > > > > > Hi, > > > > > > Sorry for this, but I need to write ASCII from my Python to be read by > > > FORTRAN and the formatting is very important. Is there any way of doing > > > anything like: > > > >

Re: FORTRAN like formatting

2005-07-09 Thread Cyril Bazin
Ok, dennis, your solution may be better, but is quite dangerous: Python can't handle if there is exactly 3 arguments passed to the function. The created code is correct but the error will appear when your run Fortran. Cyril On 7/9/05, Dennis Lee Bieber <[EMAIL PROTECTED]> wrote: > On Fri, 8 Jul 2

Re: FORTRAN like formatting

2005-07-08 Thread Cyril BAZIN
Hello, I don't anderstand very well Fortran syntax, but want you say something like that: def toTable(n1, n2, n3): return "%20s%20s%20s"%tuple(["%.12f"%x for x in [n1, n2, n3]]) Example: >>> import math >>> toTable(math.pi, 10, 8.2323) ' 3.141592653590 10. 8.232300