Path: csiph.com!fu-berlin.de!uni-berlin.de!not-for-mail From: Chris Angelico Newsgroups: comp.lang.python Subject: Re: Considering migrating to Python from Visual Basic 6 for engineering applications Date: Thu, 18 Feb 2016 21:16:15 +1100 Lines: 88 Message-ID: References: <90cc50d2-1ce5-4588-9bfd-a49d439f00dd@googlegroups.com> <14c75a68-0d2e-45cc-8d73-0d71b6a6aea6@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Trace: news.uni-berlin.de PbIBIojhsbkhP2JoCO/h/Q5L1+TKrMiUF2SgvmJlR0pQ== Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.000 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'pycon': 0.03; 'url:pypi': 0.03; 'broken': 0.03; 'exercise': 0.03; 'received:209.85.223': 0.03; 'anyway.': 0.04; 'subject:Python': 0.05; '(except': 0.05; 'compiler': 0.05; 'cpython': 0.05; 'extent': 0.07; 'interpreted': 0.07; 'pypi': 0.07; 'cc:addr:python-list': 0.09; '(currently': 0.09; 'expired': 0.09; 'newest': 0.09; 'porting': 0.09; 'sake': 0.09; 'subject:Visual': 0.09; 'whatever.': 0.09; 'wrong,': 0.09; 'python': 0.10; 'language,': 0.11; 'subject: \n ': 0.15; 'thu,': 0.15; '"extended': 0.16; '(about': 0.16; '(other': 0.16; '2016': 0.16; '[1].': 0.16; 'barrier': 0.16; 'basic.': 0.16; 'between.': 0.16; 'compilers': 0.16; 'dependent.': 0.16; 'devs': 0.16; 'different,': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'learnt': 0.16; 'library"': 0.16; 'need,': 0.16; 'received:io': 0.16; 'received:psf.io': 0.16; 'responded.': 0.16; 'rewriting': 0.16; "someone's": 0.16; 'vb.net': 0.16; 'wrote:': 0.16; 'say,': 0.18; "shouldn't": 0.18; 'python?': 0.18; 'steve': 0.18; 'language': 0.19; 'library': 0.20; 'versions': 0.20; 'windows': 0.20; 'cc:2**0': 0.20; 'cc:addr:python.org': 0.20; 'meant': 0.22; 'libraries': 0.22; 'ok.': 0.22; 'code.': 0.23; 'feb': 0.23; 'proprietary': 0.23; "haven't": 0.24; 'import': 0.24; 'somewhere': 0.24; 'written': 0.24; 'header:In-Reply-To:1': 0.24; 'script': 0.25; 'testing': 0.25; 'install': 0.25; 'linux': 0.26; 'compatible': 0.27; 'point.': 0.27; 'mostly': 0.27; 'message- id:@mail.gmail.com': 0.27; '[2]': 0.27; 'converting': 0.27; 'opposed': 0.27; 'correct': 0.28; 'microsoft,': 0.29; 'windows,': 0.29; 'board': 0.30; 'that.': 0.30; 'code': 0.30; '(we': 0.30; 'strongly': 0.30; 'entry': 0.31; 'anyone': 0.32; "can't": 0.32; 'especially': 0.32; 'core': 0.32; 'software,': 0.32; '[1]': 0.32; 'language.': 0.32; 'older': 0.32; 'though,': 0.32; 'run': 0.33; 'point': 0.33; 'source': 0.33; 'url:python': 0.33; 'effort.': 0.33; 'shift': 0.33; 'open': 0.33; 'changing': 0.34; 'correctly': 0.34; 'know.': 0.34; 'languages': 0.34; 'file': 0.34; 'running': 0.34; 'info': 0.34; 'gives': 0.35; 'received:google.com': 0.35; 'so,': 0.35; 'could': 0.35; 'clear': 0.35; 'improving': 0.35; 'platforms,': 0.35; 'something': 0.35; "isn't": 0.35; 'sometimes': 0.35; 'step': 0.36; 'community': 0.36; 'but': 0.36; 'too': 0.36; 'should': 0.36; 'difficulty': 0.66; 'fall': 0.66; 'packages,': 0.66; "they're": 0.66; 'forward': 0.66; 'worth': 0.67; '11.': 0.70; 'advantages': 0.72; 'feeling': 0.72; 'soon,': 0.76; 'satisfied': 0.83; 'chrisa': 0.84; 'enjoyable': 0.84; 'excel.': 0.84; 'history,': 0.84; 'nuclear': 0.84; 'upgrade,': 0.84; 'vba': 0.84; 'to:none': 0.91; 'reasoning': 0.91; 'thing,': 0.93 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:cc :content-type:content-transfer-encoding; bh=22ZYpX7QXP1QtG5oyngAY7Pj0IsqdPVLeIiS7+RDPTg=; b=hThFM3CyrvyYl2NLA+GEd744p0xx2o8DOAgcHwrSIeIC8JhwwPgaqAmyXDhkGvm0Rv IWmP7b/6DR6SESMd47c+onxTtYCAIj5Elq3xKh5I4+fd9plqXEMWSe22acHJMdyh1P8Y cOtKfrwFPcanGZMhEHizEkTLe0hP3cms9vXjy5MDnE/k6aHdbVYwDR6RaiGplxavwnmP Ms8hCu5augzkWtogI/HRW3F+O6QMW2sbjSra3X5a7yoczXC3EnVZj0liMERj8nRnG8FZ sQ02YqA21Pwggy1GfPlb9PIA3MZ/0tG5u/1BhM3CFISsrgG+UpnU0HAbxUA039BoCFKU kjxw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:cc:content-type:content-transfer-encoding; bh=22ZYpX7QXP1QtG5oyngAY7Pj0IsqdPVLeIiS7+RDPTg=; b=EfUn0G0mqujniZUfx1ziDK38J1nih32FGYCYjuFx8NDZdl0oKzbzpcL4mueynCwVw9 zIxTWYbitoub/H5fC7Z7OebZQHZXwcW0/ZElMSny5fCR3J7ksk1iuCkeqi2xcxG1Bj/d iMbR1SHQiHlyKDr0Cc9GfYb5CwzK8ZRFiPuAcuW18o4ebweg85j4GeB+7X6irrVnMfDt KncGru0SI6U3w0ASbrX0ISNiaikTGkaHDG+akI8Jzx9Yvvl0BO/WL0r800ixufhyPofP kTLnwXxtB3tnsE5LWV/O7T+TeG7faZ1fmw5x7w33Y3Qj9TsOIY4RoJg+4r8dwJiUXPVC dctA== X-Gm-Message-State: AG10YOSZrnCH9O9YKF/7egbdvbq9SnmXd7SBTReKVmbnn3iIv0JZRrCl0D7s5u9+VqKZdXdsamAPBXOCL6lyww== X-Received: by 10.107.14.73 with SMTP id 70mr8121620ioo.31.1455790575295; Thu, 18 Feb 2016 02:16:15 -0800 (PST) In-Reply-To: <14c75a68-0d2e-45cc-8d73-0d71b6a6aea6@googlegroups.com> X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.21rc2 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Xref: csiph.com comp.lang.python:103103 On Thu, Feb 18, 2016 at 7:17 PM, wrote: > Thanks to all of you who have responded. One point two of you ask me is w= hy 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 w= ill need, but it always gives me a feeling that it is not meant for the kin= d 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 versio= ns of Windows, you need to keep changing things in the software, which take= s too much time. You might ask if it is really necessary to move from VB6 t= o VB.net because Microsoft will still not be able to kill VB6 very soon, th= anks to VBA used in Excel. If my reasoning is wrong, please correct me. I a= m just an engineer, not a good programmer. > Very fair point. And I fully support your move, here. Just make sure you start on the latest Python (currently that's 3.5), and you should have no difficulty moving forward in versions; as someone who started writing Python 3 code back when 3.3 was the newest and latest thing, I can attest that it's been easy to migrate 3.2->3.3->3.4->3.5->3.6; there are very few things that get broken by the upgrade, and they're mostly things that would have been bad code in the older version anyway. >> The basic python language and its libraries are completely cross-platfor= m (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 t= o a bundled, self-contained image is platform dependent. There python compl= iers (as opposed to interpreters) for some, but not all platforms, and ther= e is a very active JiT compiler project that would fall somewhere in betwee= n. >> > > OK. This is clear to me now. It is like needing different Fortran compile= rs for different operating systems, but Fortran code does not need much mod= ifications (except file names/paths, etc.). > Something like that. There are a lot of little traps you can fall into (as you say, file names can be different, especially system ones) that stop your code from running correctly on all platforms, but porting a Python script from Linux to Windows or vice versa is a matter of testing it on the new platform and seeing what breaks, not completely rewriting it in a new language. >> > Could someone kindly tell me advantages and disadvantages of Python? >> >> If you are completely satisfied with VB, there is no reason to change (o= ther than the enjoyable exercise of learning a new and more powerful langua= ge). >> > > 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 L= inux or whatever. > There will indeed. That's the advantage of a fully open system - even if a nuclear meltdown kills all the Python core devs in one stroke (we really shouldn't have had PyCon Chernobyl), anyone in the world can pick up the source code and keep going with it. And Microsoft, despite having a strongly anti-freedom history, has come far more on board of recent years; as I understand it, Steve Dower has been spending company time improving Python (notably in the area of Windows installers and such). The future of open source software is pretty secure, and the future of openly-developed languages even more so, because CPython isn't the only way to run your Python code. One Python advantage that you may or may not be aware of is its extensibility. To an extent that I haven't seen since working with REXX on OS/2, there is a thriving community building Python packages, many of which (about 75K!) are listed on PyPI [1]. Got this proprietary database that you need to get info from? Check PyPI - chances are someone's written a connector for it, so you can perform queries on it as if it had native support in the language. Once you install something using "pip" [2], you can import it into your script the exact same way that you would import something from the standard library - making PyPI kinda like the "extended library" for the language. The barrier to entry is low, though, so you do sometimes have to wade through a bunch of stagnant or expired projects to find the gems you want. But there's so much good stuff there that it's well worth the effort. ChrisA [1] https://pypi.python.org/pypi [2] No, not the chipmunk from Enchanted.