Path: csiph.com!fu-berlin.de!uni-berlin.de!not-for-mail From: Oscar Benjamin Newsgroups: comp.lang.python Subject: Re: Considering migrating to Python from Visual Basic 6 for engineering applications Date: Thu, 18 Feb 2016 15:47:46 +0000 Lines: 40 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 X-Trace: news.uni-berlin.de KN9R7yHNDAO16lMZ4hcwWg86c1rqE+8Z48D97y7yfSvA== 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; 'subject:Python': 0.05; 'desirable.': 0.07; 'distributing': 0.07; 'cc:addr:python-list': 0.09; 'hiding': 0.09; 'separately': 0.09; 'subject:Visual': 0.09; 'python': 0.10; 'python.': 0.11; 'files.': 0.13; 'apps': 0.15; 'interpreter': 0.15; 'subject: \n ': 0.15; '(something': 0.16; '2016': 0.16; 'bundles': 0.16; 'cc:name:python list': 0.16; 'pyinstaller': 0.16; 'pypi.': 0.16; 'received:io': 0.16; 'received:psf.io': 0.16; 'unnecessary.': 0.16; 'x1,': 0.16; 'x2,': 0.16; 'wrote:': 0.16; 'app': 0.16; 'numerical': 0.18; 'input': 0.18; 'windows': 0.20; 'cc:2**0': 0.20; 'cc:addr:python.org': 0.20; 'extension': 0.20; 'do.': 0.22; 'file.': 0.22; 'trying': 0.22; 'code.': 0.23; 'dependent': 0.23; 'proprietary': 0.23; 'header:In-Reply-To:1': 0.24; 'install': 0.25; "doesn't": 0.26; 'installed': 0.26; 'packaging': 0.27; 'question': 0.27; 'message- id:@mail.gmail.com': 0.27; 'loads': 0.29; 'character': 0.29; "i'm": 0.30; 'code': 0.30; 'guess': 0.31; 'probably': 0.31; 'another': 0.32; "can't": 0.32; 'compiled': 0.32; 'embedded': 0.32; 'possibly': 0.32; 'file': 0.34; 'received:google.com': 0.35; 'could': 0.35; 'text': 0.35; 'something': 0.35; 'asking': 0.35; 'sometimes': 0.35; 'step': 0.36; 'but': 0.36; 'there': 0.36; 'received:209.85': 0.36; '(and': 0.36; 'basic': 0.36; 'depends': 0.36; 'modules': 0.36; 'subject:: ': 0.37; 'two': 0.37; 'doing': 0.38; 'received:209': 0.38; 'someone': 0.38; 'end': 0.39; 'means': 0.39; 'why': 0.39; 'data': 0.39; 'sure': 0.39; 'whatever': 0.39; 'does': 0.39; 'subject:from': 0.39; 'some': 0.40; 'easy': 0.60; 'your': 0.60; 'skip:u 10': 0.61; 'show': 0.62; 'box.': 0.66; "they're": 0.66; 'sounds': 0.76; 'oscar': 0.84; 'packing': 0.84; 'using.': 0.84 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type; bh=5ThGLuhrUC2wQHFGxhIdtUOpclrhuVTIVbgHcPMhv8I=; b=okCDwGE+k1kRGgChzJL5cHcKFN4+ZxvXIgtwp+6rnqYADK19x307EOAgmu76gkNwCc zO2rpccAVtI9LnV0a2B9q3WD2xVGuGfcP3t/PcheZBxgpKOq0MxCl2zQfhM1g/gW6MLU 6FFC8zwR+6umd+hAEFWkBzQxMzSKmK/27TA8BhJafmUteZrwDpbrZQA10BtEdxelxDZS kZqBlygM2tyjOuckIaMNKEJyHix53syBHKQerO0n3DwF+4/IIYM2Cc/3tDsFLZg5rd3U yE7iD85UIhsAq12vorIamMlfxGZBhoucGCKxn/NWXKazE/GmvW9pVcc/55GU+j0vv9TZ /oeA== 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:from:date :message-id:subject:to:cc:content-type; bh=5ThGLuhrUC2wQHFGxhIdtUOpclrhuVTIVbgHcPMhv8I=; b=fM82mjEbK7zBryfU9IIR0sQidOwN2WA5FV1dibvdi4BwnEUw/R+GJh7T8ZfkNfUgwW FAHSZfcZ07FMS/ZAPReN5SwU/yXaMcn1KWFjXESny5oSU+IdZQZ7xlWNO3tkew0Q5LgO BnvECGUftbFTX/s1od4w/dBTJI0K9KlmwM/1IB47FXx2dq2jfHy15wyCyemM6zsS4oXf E9Cl0JAehT8hMf0ONrnsi4SlECW6cUuLWNX9VokQwzBe5WS8rAHSIpP2mP0H5DkvE1C1 am9hb/Bf924da/ITpDSMBrm7jIsPaoBj4JOAfDxfx44bKK1kEzSmgZnCKDIZbklRobEA YcEg== X-Gm-Message-State: AG10YOQ9FMaLQFbI3x9wwueol/7vCyJ/eJIZr3oplX/46k4j9Ly7+KbJTL4ViB3NrfMCQjOVlmqgVDKoID+IaA== X-Received: by 10.112.181.196 with SMTP id dy4mr3502361lbc.42.1455810485931; Thu, 18 Feb 2016 07:48:05 -0800 (PST) In-Reply-To: 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:103126 On 18 February 2016 at 15:33, 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