Path: csiph.com!fu-berlin.de!uni-berlin.de!not-for-mail From: Lutz Horn Newsgroups: comp.lang.python Subject: Re: Can Python learn from Perl? Perl 5 can now run Perl 6 code Date: Thu, 28 Jul 2016 09:33:48 +0200 Lines: 25 Message-ID: References: <5799b283$0$11118$c3e8da3@news.astraweb.com> Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-Trace: news.uni-berlin.de SI7sqAm4sGi0e2hCP0WOXgRPswaPvVmgsZ4Z/wkZXKmw== Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.025 X-Spam-Evidence: '*H*': 0.95; '*S*': 0.00; 'subject:Python': 0.05; 'python3': 0.05; 'executable': 0.07; 'subject:code': 0.07; 'python': 0.10; 'code?': 0.16; 'executable,': 0.16; 'received:io': 0.16; 'received:psf.io': 0.16; 'recognise': 0.16; 'subject:run': 0.16; 'file.': 0.22; 'trying': 0.22; 'code.': 0.23; 'header:In- Reply-To:1': 0.24; 'feature': 0.24; 'header:User-Agent:1': 0.26; 'external': 0.27; 'skip:# 10': 0.27; 'least': 0.27; 'perl': 0.29; 'python2.7': 0.29; 'code': 0.30; 'run': 0.33; 'steven': 0.33; 'file': 0.34; 'something': 0.35; 'but': 0.36; 'should': 0.36; 'instead': 0.36; 'url:org': 0.36; 'to:addr:python-list': 0.36; 'subject:: ': 0.37; 'mean': 0.38; 'hi,': 0.38; 'why': 0.39; 'subject:from': 0.39; 'to:addr:python.org': 0.40; 'received:de': 0.40; 'charset:windows-1252': 0.62; 'improved': 0.63; 'here': 0.66; 'subject:now': 0.70; 'received:89': 0.80; "d'aprano:": 0.84; 'received:89.146': 0.84; 'subject:learn': 0.84; 'received:185': 0.91 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 In-Reply-To: <5799b283$0$11118$c3e8da3@news.astraweb.com> X-Mailman-Approved-At: Thu, 28 Jul 2016 03:37:07 -0400 X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Mailman-Original-Message-ID: X-Mailman-Original-References: <5799b283$0$11118$c3e8da3@news.astraweb.com> Xref: csiph.com comp.lang.python:111970 Hi, Am 07/28/2016 um 09:21 AM schrieb Steven D'Aprano: > But Perl has a feature that > if you tell it to run a file with a hashbang line, it will call the given > executable to run that file. That's now been improved to recognise Perl6 as an > external executable, instead of trying to run it as Perl 5 code. > Should Python do something similar? At least for Python 2/3 code? Do you mean something like #!/usr/bin/env python2.7 # here comes Python 3 code should be run using python3, if installed? Why not just put the python3 executable into the hashbang line? Lutz -- https://www.lhorn.de/ https://emailselfdefense.fsf.org/de/