Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #68586
| Path | csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!news.mixmin.net!feeds.phibee-telecom.net!newsfeed.xs4all.nl!newsfeed4a.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail |
|---|---|
| Return-Path | <zachary.ware@gmail.com> |
| X-Original-To | python-list@python.org |
| Delivered-To | python-list@mail.python.org |
| X-Spam-Status | OK 0.003 |
| X-Spam-Evidence | '*H*': 0.99; '*S*': 0.00; 'scripts': 0.03; 'anyway.': 0.05; 'interpreter': 0.05; 'interpreter.': 0.07; 'scripts,': 0.09; 'python': 0.11; 'assume': 0.14; '2.7': 0.14; '"python': 0.16; 'filename.': 0.16; 'specifying': 0.16; 'w/o': 0.16; 'subject:python': 0.16; 'sender:addr:gmail.com': 0.17; 'wrote:': 0.18; 'file,': 0.19; 'thu,': 0.19; 'not,': 0.20; 'command': 0.22; 'putting': 0.22; 'to:name:python-list@python.org': 0.22; '(by': 0.24; 'necessary.': 0.24; 'script': 0.25; 'header:In-Reply-To:1': 0.27; 'wondering': 0.29; 'am,': 0.29; 'message- id:@mail.gmail.com': 0.30; '(which': 0.31; 'invoke': 0.31; 'python"': 0.31; 'question:': 0.31; 'safely': 0.31; 'probably': 0.32; 'run': 0.32; 'guess': 0.33; 'actual': 0.34; 'received:google.com': 0.35; 'version': 0.36; 'so,': 0.37; 'to:addr:python-list': 0.38; 'files': 0.38; 'short': 0.38; 'anything': 0.39; 'to:addr:python.org': 0.39; 'either': 0.39; 'how': 0.40; "you're": 0.61; 'more': 0.64; 'mar': 0.68; '20,': 0.68; 'etc),': 0.84; 'that)': 0.84; 'directly.': 0.95 |
| DKIM-Signature | v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:content-type; bh=Jn6SAqetlzXrFsP5j+hRy9/GFctIjnFgkXHD/biKrjw=; b=TLKAXbWRHYKK2HU8YDScyWBOtM1hmSHfT9wWlIpyXmDuLvg5gbsOokAMb8Wikr3rE2 2VikOnKy271WCzd0A1oOZjlAZ7jguQao23X0C10OzTWyjsYBhdh9fQYLXGjvRkEjqDDx eFHY75LweoFm0RFwQ2/wSTCTqQOZQFUlHhTlH/koIY6F5gHPrusVl8prSZIV/Qa2AWPh zfHNc87O89+ErYC+zUTKM3Cncb2XQ0zgyKKoN/dnRqJBOokiNP1ghYhwhzsITgt9Hvvl Gm41fA9IEG+Joa6JwI2IMJQkIe7NUzdI0wNfEdOyBzfR+6cA45tas2j4M/YfeZbHLCg+ DHCg== |
| X-Received | by 10.50.141.199 with SMTP id rq7mr3778993igb.11.1395332145147; Thu, 20 Mar 2014 09:15:45 -0700 (PDT) |
| MIME-Version | 1.0 |
| Sender | zachary.ware@gmail.com |
| In-Reply-To | <bp0hk7F613oU3@mid.individual.net> |
| References | <bp0e1eF613oU1@mid.individual.net> <87ob10nbeh.fsf@elektro.pacujo.net> <bp0hk7F613oU3@mid.individual.net> |
| From | Zachary Ware <zachary.ware+pylist@gmail.com> |
| Date | Thu, 20 Mar 2014 11:14:54 -0500 |
| X-Google-Sender-Auth | plA106KdD-Uuo9kx61mrPoz59m4 |
| Subject | Re: running python 2 vs 3 |
| To | "python-list@python.org" <python-list@python.org> |
| Content-Type | text/plain; charset=UTF-8 |
| X-BeenThere | python-list@python.org |
| X-Mailman-Version | 2.1.15 |
| Precedence | list |
| List-Id | General discussion list for the Python programming language <python-list.python.org> |
| List-Unsubscribe | <https://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe> |
| List-Archive | <http://mail.python.org/pipermail/python-list/> |
| List-Post | <mailto:python-list@python.org> |
| List-Help | <mailto:python-list-request@python.org?subject=help> |
| List-Subscribe | <https://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe> |
| Newsgroups | comp.lang.python |
| Message-ID | <mailman.8304.1395332703.18130.python-list@python.org> (permalink) |
| Lines | 20 |
| NNTP-Posting-Host | 2001:888:2000:d::a6 |
| X-Trace | 1395332703 news.xs4all.nl 2886 [2001:888:2000:d::a6]:37218 |
| X-Complaints-To | abuse@xs4all.nl |
| Xref | csiph.com comp.lang.python:68586 |
Show key headers only | View raw
On Thu, Mar 20, 2014 at 11:00 AM, notbob <notbob@nothome.com> wrote: > Ahhh! ....now a shabang I understand. So, I guess the only way, short > of looking at the actual file, is to include the version in the > filename. Can I safely assume I can run all 2.7 files w/o a shebang > (which I have not, so far, and was wondering how I got away with that) > and only include a py3 shebang in the py3 files, yes/no? If I understand your question: you're probably better off putting a shebang line in all of the files that you intend to run directly. Use "/usr/bin/env python2" for your Python 2 scripts, "/usr/bin/env python3" for your Python 3 scripts, and "/usr/bin/env python" for scripts that can run under either interpreter. You can also be more version-specific if you need to; use "python2.7", "python3.3", etc. as necessary. That way, you can invoke the script directly and the right interpreter will run it. If you're specifying the interpreter in your command (by calling "python <scriptname>.py", etc), the shebang won't mean anything anyway. -- Zach
Back to comp.lang.python | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
running python 2 vs 3 notbob <notbob@nothome.com> - 2014-03-20 14:58 +0000
Re: running python 2 vs 3 Marko Rauhamaa <marko@pacujo.net> - 2014-03-20 17:21 +0200
Re: running python 2 vs 3 notbob <notbob@nothome.com> - 2014-03-20 16:00 +0000
Re: running python 2 vs 3 Zachary Ware <zachary.ware+pylist@gmail.com> - 2014-03-20 11:14 -0500
Re: running python 2 vs 3 notbob <notbob@nothome.com> - 2014-03-20 17:10 +0000
Re: running python 2 vs 3 Chris Angelico <rosuav@gmail.com> - 2014-03-21 04:30 +1100
Re: running python 2 vs 3 Gary Herron <gary.herron@islandtraining.com> - 2014-03-20 10:45 -0700
Re: running python 2 vs 3 John Gordon <gordon@panix.com> - 2014-03-20 19:07 +0000
Re: running python 2 vs 3 Terry Reedy <tjreedy@udel.edu> - 2014-03-20 18:05 -0400
Re: running python 2 vs 3 alex23 <wuwei23@gmail.com> - 2014-03-21 12:37 +1000
Re: running python 2 vs 3 Michael Torrie <torriem@gmail.com> - 2014-03-20 15:44 -0600
Re: running python 2 vs 3 Mark Lawrence <breamoreboy@yahoo.co.uk> - 2014-03-20 18:56 +0000
Re: running python 2 vs 3 Eric Jacoboni <eric.jacoboni@gmail.com> - 2014-03-20 20:07 +0100
Re: running python 2 vs 3 Ned Batchelder <ned@nedbatchelder.com> - 2014-03-20 16:26 -0400
Re: running python 2 vs 3 notbob <notbob@nothome.com> - 2014-03-20 21:16 +0000
Re: running python 2 vs 3 Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2014-03-21 00:32 +0000
Re: running python 2 vs 3 Ned Batchelder <ned@nedbatchelder.com> - 2014-03-20 21:06 -0400
Re: running python 2 vs 3 Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2014-03-21 03:16 +0000
Re: running python 2 vs 3 Chris Angelico <rosuav@gmail.com> - 2014-03-21 14:34 +1100
Re: running python 2 vs 3 Chris Angelico <rosuav@gmail.com> - 2014-03-21 12:10 +1100
Re: running python 2 vs 3 Ned Batchelder <ned@nedbatchelder.com> - 2014-03-20 21:20 -0400
Re: running python 2 vs 3 Alan Meyer <ameyer2@yahoo.com> - 2014-03-20 15:53 -0400
Re: running python 2 vs 3 Marko Rauhamaa <marko@pacujo.net> - 2014-03-20 22:08 +0200
Re: running python 2 vs 3 Mark Lawrence <breamoreboy@yahoo.co.uk> - 2014-03-20 20:22 +0000
Re: running python 2 vs 3 Marko Rauhamaa <marko@pacujo.net> - 2014-03-20 22:30 +0200
Re: running python 2 vs 3 Zachary Ware <zachary.ware+pylist@gmail.com> - 2014-03-20 15:43 -0500
Re: running python 2 vs 3 Mark Lawrence <breamoreboy@yahoo.co.uk> - 2014-03-20 20:44 +0000
Re: running python 2 vs 3 Marko Rauhamaa <marko@pacujo.net> - 2014-03-20 22:50 +0200
Re: running python 2 vs 3 Mark Lawrence <breamoreboy@yahoo.co.uk> - 2014-03-20 21:36 +0000
Re: running python 2 vs 3 Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2014-03-21 00:59 +0000
Re: running python 2 vs 3 Roy Smith <roy@panix.com> - 2014-03-20 21:06 -0400
Re: running python 2 vs 3 Chris Angelico <rosuav@gmail.com> - 2014-03-21 13:18 +1100
Re: running python 2 vs 3 Mark Lawrence <breamoreboy@yahoo.co.uk> - 2014-03-21 09:40 +0000
Re: running python 2 vs 3 alister <alister.nospam.ware@ntlworld.com> - 2014-03-21 12:09 +0000
Re: running python 2 vs 3 Chris Angelico <rosuav@gmail.com> - 2014-03-21 12:15 +1100
Re: running python 2 vs 3 Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2014-03-20 22:39 +0000
Re: running python 2 vs 3 Ned Batchelder <ned@nedbatchelder.com> - 2014-03-20 16:27 -0400
Re: running python 2 vs 3 Marko Rauhamaa <marko@pacujo.net> - 2014-03-20 22:42 +0200
Re: running python 2 vs 3 Ned Batchelder <ned@nedbatchelder.com> - 2014-03-20 16:53 -0400
Re: running python 2 vs 3 Marko Rauhamaa <marko@pacujo.net> - 2014-03-20 22:59 +0200
Re: running python 2 vs 3 Chris Kaynor <ckaynor@zindagigames.com> - 2014-03-20 14:18 -0700
Re: running python 2 vs 3 Ned Batchelder <ned@nedbatchelder.com> - 2014-03-20 17:31 -0400
Re: running python 2 vs 3 Marko Rauhamaa <marko@pacujo.net> - 2014-03-21 00:23 +0200
Re: running python 2 vs 3 Mark Lawrence <breamoreboy@yahoo.co.uk> - 2014-03-20 22:42 +0000
Re: running python 2 vs 3 Chris Angelico <rosuav@gmail.com> - 2014-03-21 10:18 +1100
Re: running python 2 vs 3 Marko Rauhamaa <marko@pacujo.net> - 2014-03-21 07:49 +0200
Re: running python 2 vs 3 Chris Angelico <rosuav@gmail.com> - 2014-03-21 16:54 +1100
Re: running python 2 vs 3 Marko Rauhamaa <marko@pacujo.net> - 2014-03-21 08:08 +0200
Re: running python 2 vs 3 Rustom Mody <rustompmody@gmail.com> - 2014-03-20 23:51 -0700
Re: running python 2 vs 3 Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2014-03-21 00:37 +0000
Re: running python 2 vs 3 Ethan Furman <ethan@stoneleaf.us> - 2014-03-20 18:23 -0700
Re: running python 2 vs 3 Rustom Mody <rustompmody@gmail.com> - 2014-03-20 19:20 -0700
Re: running python 2 vs 3 Chris Angelico <rosuav@gmail.com> - 2014-03-21 10:04 +1100
Re: running python 2 vs 3 Mark H Harris <harrismh777@gmail.com> - 2014-03-20 15:10 -0500
Re: running python 2 vs 3 notbob <notbob@nothome.com> - 2014-03-20 21:28 +0000
Re: running python 2 vs 3 Mark H Harris <harrismh777@gmail.com> - 2014-03-20 16:46 -0500
Re: running python 2 vs 3 Marko Rauhamaa <marko@pacujo.net> - 2014-03-21 00:17 +0200
Re: running python 2 vs 3 Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2014-03-21 00:29 +0000
Re: running python 2 vs 3 Dan Stromberg <drsalists@gmail.com> - 2014-03-20 13:38 -0700
Re: running python 2 vs 3 Marko Rauhamaa <marko@pacujo.net> - 2014-03-20 22:46 +0200
Re: running python 2 vs 3 Mark H Harris <harrismh777@gmail.com> - 2014-03-20 11:11 -0500
Re: running python 2 vs 3 notbob <notbob@nothome.com> - 2014-03-20 17:23 +0000
Re: running python 2 vs 3 Chris Angelico <rosuav@gmail.com> - 2014-03-21 04:29 +1100
Re: running python 2 vs 3 Marko Rauhamaa <marko@pacujo.net> - 2014-03-20 19:45 +0200
Re: running python 2 vs 3 Mark H Harris <harrismh777@gmail.com> - 2014-03-20 12:42 -0500
Re: running python 2 vs 3 Marko Rauhamaa <marko@pacujo.net> - 2014-03-20 19:47 +0200
Re: running python 2 vs 3 Ned Batchelder <ned@nedbatchelder.com> - 2014-03-20 14:45 -0400
Re: running python 2 vs 3 Mark H Harris <harrismh777@gmail.com> - 2014-03-20 14:36 -0500
Re: running python 2 vs 3 Terry Reedy <tjreedy@udel.edu> - 2014-03-20 17:52 -0400
Re: running python 2 vs 3 notbob <notbob@nothome.com> - 2014-03-20 22:19 +0000
csiph-web