Path: csiph.com!fu-berlin.de!uni-berlin.de!not-for-mail From: Tim Chase Newsgroups: comp.lang.python Subject: Re: Considering migrating to Python from Visual Basic 6 for engineering applications Date: Thu, 18 Feb 2016 13:28:07 -0600 Lines: 22 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=US-ASCII Content-Transfer-Encoding: 7bit X-Trace: news.uni-berlin.de HqB7/T6/mfTgj9cs2wi7+gZ0vSsJzHX43jljHJLDLAmg== Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.001 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'subject:Python': 0.05; 'slices': 0.09; 'subject:Visual': 0.09; 'files.': 0.13; 'subject: \n ': 0.15; '(also': 0.16; '(something': 0.16; '-tkc': 0.16; 'binary,': 0.16; 'from:addr:python.list': 0.16; 'from:addr:tim.thechases.com': 0.16; 'from:name:tim chase': 0.16; 'received:io': 0.16; 'received:psf.io': 0.16; 'x1,': 0.16; 'x2,': 0.16; 'wrote:': 0.16; 'numerical': 0.18; 'input': 0.18; 'library': 0.20; 'code,': 0.23; "python's": 0.23; 'header:In-Reply-To:1': 0.24; 'module': 0.25; 'example': 0.26; 'question': 0.27; 'data,': 0.27; 'finally,': 0.27; 'this.': 0.28; 'character': 0.29; 'fixed': 0.31; 'another': 0.32; 'up.': 0.32; 'usually': 0.33; 'text': 0.35; 'mapping': 0.35; 'but': 0.36; 'basic': 0.36; 'data.': 0.36; 'to:addr:python-list': 0.36; 'subject:: ': 0.37; 'received:10': 0.37; 'charset:us-ascii': 0.37; 'doing': 0.38; 'data': 0.39; 'subject:from': 0.39; 'to:addr:python.org': 0.40; 'some': 0.40; 'email addr:gmail.com': 0.62; 'received:46': 0.63 X-Sender-Id: wwwh|x-authuser|tim@thechases.com X-Sender-Id: wwwh|x-authuser|tim@thechases.com X-MC-Relay: Neutral X-MailChannels-SenderId: wwwh|x-authuser|tim@thechases.com X-MailChannels-Auth-Id: wwwh X-MC-Loop-Signature: 1455823853886:1070413943 X-MC-Ingress-Time: 1455823853886 In-Reply-To: X-Mailer: Claws Mail 3.11.1 (GTK+ 2.24.25; x86_64-pc-linux-gnu) X-AuthUser: tim@thechases.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:103146 On 2016-02-18 07:33, wrong.address.1@gmail.com wrote: > 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)? A lot of my work is extracting data from text files. If it's CSV-format data, Python's "csv" module in the standard library offers some nice tools for doing this. If the numbers are in plain-text, but at fixed column-offsets, I usually create a mapping of slices to make it easier to work with. If this is the case and you want some example code, I can dig some up. Finally, if the data is actually binary, Python's "struct" module (also in the standard library) makes it a lot easier to work with such data. -tkc