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 03:17:42 EST 2016


Thanks to all of you who have responded. One point two of you ask me is why I want to shift from Visual Basic. 

Most of my software is in VB6 (and VB3), and converting to VB.net is not very pleasant. I have learnt enough VB.net to manage most of the things I will need, but it always gives me a feeling that it is not meant for the kind of things I am doing. And you never know when Microsoft will kick us out of VB.net also. For the sake of keeping software compatible with new versions of Windows, you need to keep changing things in the software, which takes too much time. You might ask if it is really necessary to move from VB6 to VB.net because Microsoft will still not be able to kill VB6 very soon, thanks to VBA used in Excel. If my reasoning is wrong, please correct me. I am just an engineer, not a good programmer.

Is it easy to create vector graphics files of plots in Python? In VB6, I wrote my own code to generate EPS files. Then people who demand jpg and gif files could be given those by converting the EPS with the desired resolution.

More points in the text below.

William Ray Wing writes:
> > On Feb 17, 2016, at 2:49 PM, wrong.address.1 at gmail.com wrote:
> > 
> > It seems Python is used more for web based applications. Is it equally fine for creating stand-alone *.exe's? Can the same code be compiled to run on Linux or Android or web-based?
> > 
> 
> I'm not sure where you got that idea.  Python has been and is being used for an extremely broad range of applications.  At one extreme, the popular YouTube site is based on Python (and yes, that is a web application), at the other extreme much (most?) of the data analysis of the recent LIGO data leading up to the discovery of gravitational waves was done in Python, and numpy (a python numerical library); with the results displayed in matplotlib (a python library for scientific-engineering graphics).
> 

This is good news, because I need several kinds of plots.

> The basic python language and its libraries are completely cross-platform (Linux, OS-X, Windows, iOS, and Android).  The same source code will run on all of them.  However, because it is an Interpreted language, the step to a bundled, self-contained image is platform dependent. There python compliers (as opposed to interpreters) for some, but not all platforms, and there is a very active JiT compiler project that would fall somewhere in between. 
> 

OK. This is clear to me now. It is like needing different Fortran compilers for different operating systems, but Fortran code does not need much modifications (except file names/paths, etc.).

> > Is it possible to create GUI elements with a good IDE? Can they be defined like in Visual Basic with given sizes, fonts, visible/invisible, etc.?
> > 
> 
> There are several GUI libraries for Python.  You might check out TK (which comes built-in), but there are also libraries like wxPython, Kivi (which is completely cross platform), and PyQt.  Note that these are the GUI libraries themselves, not IDE's which tend to be independent.  There are too many IDE's to list here - check with Google.
> 
> > Is it easy to do matrix operations in Python? Or do I need to write subroutines like in Visual Basic?
> 
> Matrix (and similar operations) can be done in Python directly, but if you need maximum performance you should use the optimized vector routines available 

Speed is usually not an issue.

> in numpy, these are typically pre-compiled with C or FORTRAN and squeeze out the maximum speed your hardware is capable of.  (There is work being done to migrate them to GPUs, but is VERY hardware dependent at this point.) If you need to do scientific/engineering analysis, you should also check out scipy, which is built on top of it and is also vector optimized.
> 
> > 
> > Could someone kindly tell me advantages and disadvantages of Python?
> 
> If you are completely satisfied with VB, there is no reason to change (other than the enjoyable exercise of learning a new and more powerful language).
> 

Will VB6 run on Windows 11? Or can I compile VB6 on Windows 11. We can't know. But there will be easy ways to run Python on any Windows version or Linux or whatever.

> On the other hand, Python has often been referred to as "executable pseudo code" - in other words, the english-like steps you might sketch out to outline the solution to a programming problem in another language is to all intents and purposes Python itself.  This makes for very fast and productive code generation with typically fewer errors than are made in other languages. In addition, and as has been implied above, it is cross platform.  The same python source code (with the appropriate libraries) will run on all the platforms mentioned above. One of the biggest productive features of Python is the fact that it is interpreted (in its most common instantiation).  Thus, you can have two windows open side by side, with the source code in one and running code in the other.  Changes in the source code can instantly be reflected in the output.
> 
> > Or any better options? I have like 40-50 VB Forms and may be around 20000 lines of code. It will be a task to learn a new language and translate/re-write that code.
> > 
> 
> Not necessarily better, but at least worth looking into would be the Swift language, which shares much of Python's modern structure, is now also open source, and has been ported to most flavors of Linux.  A Window's port is promised, but I don't know how far along it is.  It *is* a compiled language, so you would then be back in the edit, compile, link, and run loop as you debug your code.
> 
> I'm sure you will get lots of other answers - Google each of the things I've mentioned and you will get a truck-load of info.  You might start with Wikipedia and read there about Python and Swift.
> 
> > Thanks for your responses. 

Thanks again to all of you who have responded.

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




More information about the Python-list mailing list