From bf72b78ef2110f4bda6105b8adff131dc9435bff Mon Sep 17 00:00:00 2001 From: Eli Flanagan <163922304+eflanagan0@users.noreply.github.com> Date: Mon, 3 Jun 2024 17:22:50 -0400 Subject: [PATCH] docs: fix python nix-shell example (#10841) * docs: fix python nix-shell example This Python code snippet depended on Python 2 which has been marked as insecure in 24.05. I modernized the example so new users will not be surprised upon copying and pasting the snippet for exploration. Co-authored-by: John Ericson --- doc/manual/src/command-ref/nix-shell.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/manual/src/command-ref/nix-shell.md b/doc/manual/src/command-ref/nix-shell.md index 1eaf3c36a..a4dd051fc 100644 --- a/doc/manual/src/command-ref/nix-shell.md +++ b/doc/manual/src/command-ref/nix-shell.md @@ -202,14 +202,14 @@ For example, here is a Python script that depends on Python and the ```python #! /usr/bin/env nix-shell -#! nix-shell -i python --packages python pythonPackages.prettytable +#! nix-shell -i python3 --packages python3 python3Packages.prettytable import prettytable # Print a simple table. t = prettytable.PrettyTable(["N", "N^2"]) for n in range(1, 10): t.add_row([n, n * n]) -print t +print(t) ``` Similarly, the following is a Perl script that specifies that it