All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Elliott, Robert (Servers)" <elliott@hpe.com>
To: Vincent Fu <vincentfu@gmail.com>,
	Rebecca Cran <rebecca@bsdio.com>,
	"fio@vger.kernel.org" <fio@vger.kernel.org>
Cc: Jens Axboe <axboe@kernel.dk>
Subject: RE: Python scripts - /usr/bin/env python3 vs python vs python2.7
Date: Wed, 27 May 2020 18:10:57 +0000	[thread overview]
Message-ID: <CS1PR8401MB1237B6211F30F9C8C1450CE1ABB10@CS1PR8401MB1237.NAMPRD84.PROD.OUTLOOK.COM> (raw)
In-Reply-To: <87ec264a-c0cd-2868-4173-f7d52297e7d5@gmail.com>


> -----Original Message-----
> From: fio-owner@vger.kernel.org <fio-owner@vger.kernel.org> On Behalf
> Of Vincent Fu
> Sent: Tuesday, May 26, 2020 9:33 AM
> To: Rebecca Cran <rebecca@bsdio.com>; fio@vger.kernel.org
> Cc: Jens Axboe <axboe@kernel.dk>
> Subject: Re: Python scripts - /usr/bin/env python3 vs python vs
> python2.7
> 
> On 5/26/20 10:13 AM, Rebecca Cran wrote:
> > Python scripts in fio use a variety of methods to run the python
> > interpreter: t/run_fio_tests.py has "#!/usr/bin/env python3" while
> > t/strided.py has "#!/usr/bin/python", and sgunmap-test.py has
> > "#!/usr/bin/python2.7".
> >
> >
> > Would there any interest in converting them all to use
> > "#!/usr/bin/env python3 ?
> 
> I think having a uniform python interpreter line would be a good
> thing.

I have been using python a lot recently and also noticed that the
/usr/bin/env format is the preferred approach; it works best across
linux distros, local installs, and is even recognized by Python in
Windows.

Most of the scripts include comments claiming python3 compatibility;
one does not.

t/sgunmap-perf.py:#!/usr/bin/python2.7
t/sgunmap-perf.py:# REQUIREMENTS
t/sgunmap-perf.py:# Python 2.6+

t/sgunmap-test.py:#!/usr/bin/python2.7
t/sgunmap-test.py:# Note: this script is python2 and python 3 compatible.

t/steadystate_tests.py:#!/usr/bin/env python
t/steadystate_tests.py:# Note: this script is python2 and python3 compatible.

t/strided.py:#!/usr/bin/python
t/strided.py:# Note: this script is python2 and python3 compatible.

tools/fiologparser.py:#!/usr/bin/python2.7
tools/fiologparser.py:#!/# Note: this script is python2 and python 3 compatible.



  reply	other threads:[~2020-05-27 18:10 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-26 14:13 Python scripts - /usr/bin/env python3 vs python vs python2.7 Rebecca Cran
2020-05-26 14:32 ` Vincent Fu
2020-05-27 18:10   ` Elliott, Robert (Servers) [this message]
2020-05-28  8:19     ` Sitsofe Wheeler
2020-05-28 19:24       ` Vincent Fu
2020-05-29 20:42       ` Elliott, Robert (Servers)
2020-05-30  3:36         ` Sitsofe Wheeler
2020-06-02 12:31       ` Martin Steigerwald

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CS1PR8401MB1237B6211F30F9C8C1450CE1ABB10@CS1PR8401MB1237.NAMPRD84.PROD.OUTLOOK.COM \
    --to=elliott@hpe.com \
    --cc=axboe@kernel.dk \
    --cc=fio@vger.kernel.org \
    --cc=rebecca@bsdio.com \
    --cc=vincentfu@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.