From: "jgart" <jgart@dismail.de>
To: "zimoun" <zimon.toutoune@gmail.com>, help-guix@gnu.org
Subject: Re: shebang for python script?
Date: Fri, 27 Jan 2023 06:10:22 +0000 [thread overview]
Message-ID: <d6c809c270cd934b1e24a20e53ad5fa6@dismail.de> (raw)
In-Reply-To: <86zga7554a.fsf@gmail.com>
Hi, thanks!!
Should we document this approach in the manual somewhere?
If so, where would be a good place to mention how to do this?
> --8<---------------cut here---------------start------------->8---
> #!/usr/bin/env -S guix shell python -- python3
> import numpy as np
> a = np.array([1,2])
> b = np.array([3,4])
> print(f"The dot product of {a} and {b} is: {np.dot(a, b)}")
> --8<---------------cut here---------------end--------------->8---
>
> And to answer your other question about specific revision, I would do:
>
> --8<---------------cut here---------------start------------->8---
> #!/usr/bin/env -S guix time-machine --commit=29efa27 -- shell python -- python3
> import numpy as np
> a = np.array([1,2])
> b = np.array([3,4])
> print(f"The dot product of {a} and {b} is: {np.dot(a, b)}")
> --8<---------------cut here---------------end--------------->8---
>
> Cheers,
> simon
next prev parent reply other threads:[~2023-01-27 6:11 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-01-25 6:09 shebang for python script? jgart
2023-01-25 6:12 ` jgart
2023-01-25 9:35 ` zimoun
2023-01-27 6:10 ` jgart [this message]
2023-01-27 11:15 ` Simon Tournier
2023-01-27 15:42 ` jgart
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
List information: https://guix.gnu.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=d6c809c270cd934b1e24a20e53ad5fa6@dismail.de \
--to=jgart@dismail.de \
--cc=help-guix@gnu.org \
--cc=zimon.toutoune@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).