Considering migrating to Python from Visual Basic 6 for engineering applications

wrong.address.1 at gmail.com wrong.address.1 at gmail.com
Thu Feb 18 12:38:03 EST 2016


On Thursday, 18 February 2016 17:59:59 UTC+2, William Ray Wing  wrote:
> > On Feb 18, 2016, at 10:33 AM, wrong.address.1 at gmail.com wrote:
> > 
> > torstai 18. helmikuuta 2016 17.21.32 UTC+2 Oscar Benjamin kirjoitti:
> >> On 18 February 2016 at 11:32, Chris Angelico <rosuav at gmail.com> wrote:
> >> 
> 
> [byte]
> 
> >> It sounds to me as if all of your needs can be solved in pure Python
> >> code possibly using some of the popular extension modules from PyPI.
> >> In this case it's actually very easy to package/install. You can
> >> package your code simply by zipping it up with a __main__.py file.
> >> Someone who wants to install it will simply have a two step process:
> >> first install Python (and possibly a few dependencies) and then obtain
> >> the zip file with your code in it.
> >> 
> >> --
> >> Oscar
> > 
> > This form of packing is not desirable. I can't ask other people to install Python on their machines, and I also would not want show most of the code doing the calculations.
> > 
> 
> Now things get tricky.  I can understand you not wanting to force people to pre-install Python in order for your code to run, but just how deeply do you want to hide or obfuscate it? 

I don't have to hide it very carefully. If it creates machine code which can be decompiled, I am not very bothered, but I do not want to show many of the equations I will embed in the code, very openly. These will be different for different people, so nobody will have much motivation to break open the code. One *.exe is likely to be used by 2 or 3 people, and then for someone else, I would create another very similar *.exe with somewhat different equations. This is just one of the things I intend to do. Then there are several calculation and plotting routines for my work, which won't be given to anyone, where the issue of secrecy does not arise.

> Is this potentially a commercial application to be sold, or are you simply trying to keep things clean and tidy within various divisions of your company.  I'd hope not the former, because even VB can get you into tricky licensing issues (and in any case - even fully compiled code in any language these days can be de-compiled into logically correct source code, although with less than obvious variable names). 

Decompiling machine code I am not at all worried about. The decompiled code will be too messy for people to study. (I won't be writing simple algebraic equations in one or two lines.)

> At the other extreme, there are packaging programs (py2exe comes to mind, although I have no experience with it).  These wrap the whole python interpreter, your code, and any needed libraries into an executable (clickable) package.  Their only downside is that the output packages they produce tend to be large.  However, any sophisticated user who digs into them WILL be able to find your source code, possibly only slightly obfuscated by being zipped.
> 

This is not good if the source code with actual variable names becomes visible. Then I would have to use misleading variable names, and call temperature a flow rate, and pressure a magnetic field; stuff a lot of matrix equations which do nothing but get the decoders to waste a huge amount of time.

> > Another question I have is regarding reading numerical data from text files. Is it necessary to read one character at a time, or can one read like in Fortran and Basic (something like Input #5, X1, X2, X3)?
> 
> Python can read lines of text or whole blocks of text from source files.  If those files are in more or less well-understood form (csv for example) it has libraries specifically designed for reading and extracting data from them (including VERY nice facilities for doing arithmetic and otherwise manipulating time and date data).
> 

That is good. VB.net also has, but in the beginning I got the impression that you could read only one character as a time in a stream.

> Bill
> 
> > -- 
> > https://mail.python.org/mailman/listinfo/python-list



More information about the Python-list mailing list