Considering migrating to Python from Visual Basic 6 for engineering applications

Oscar Benjamin oscar.j.benjamin at gmail.com
Thu Feb 18 10:47:46 EST 2016


On 18 February 2016 at 15:33,  <wrong.address.1 at gmail.com> wrote:
>> 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.
>
> 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.

This is what sometimes makes packaging Python apps difficult.
Distributing code as a zip file is easy and works out of the box.
However a lot of people are very insistent that asking the end user to
first install Python is unacceptable. That's why I said it depends
what you're trying to do. I guess from your description that you want
other people to be able to install and use your proprietary
applications on whatever OS they're using.

You would probably want to use something like pyinstaller then as this
bundles a Python interpreter with your code. For Windows there's also
the embedded Python distribution which you can ship as part of an
installer for your program. For OSX/Linux Python is most likely
already installed so this may be unnecessary.

In terms of hiding the code doing the calculations: it doesn't work
like that in Python. The code is not compiled so if the end user has
your app then they have your code. You could probably use something
like Cython to obfuscate it but then this means that your compiled
code is architecture/platform dependent so you need to compile it
separately for each platform and there are other problems.

> 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)?

There are loads of ways to read your data in from text files. I don't
know how it works in Fortran and Basic but I'm sure there will be
something that does what you want.

--
Oscar



More information about the Python-list mailing list