Considering migrating to Python from Visual Basic 6 for engineering applications

BartC bc at freeuk.com
Fri Feb 19 18:06:07 EST 2016


On 19/02/2016 18:14, wrong.address.1 at gmail.com wrote:
> On Friday, 19 February 2016 16:08:46 UTC+2, Tim Chase  wrote:

> All this I could do with one Read or Input statement in Fortran and Basic.

I agree with you completely. This stuff is far more complicated than it 
need be. And the fact that there a hundred possible ways of doing it 
doesn't help!

It seems modern languages don't like having i/o as part of the language 
but prefer to have function libraries deal with it. And it still seems 
to be largely DIY...

Although the approach used by Peter Otten doesn't seem too bad. Then you 
would end up writing something like this:

     a,b,c,d,e = readline(f, "iffii")

with f being a file handle. You'd need to deal with tokens (in the 
implementation of readline), but not individual characters of each number.

(Remember that Fortran and VB6 are be statically typed, so the language 
knows what types to read into each of those variables. And the Fortran 
might have a 'format' to help out, unless they've got rid of those since 
1979...)

-- 
Bartc


More information about the Python-list mailing list