mirror of
https://github.com/privatevoid-net/nix-super.git
synced 2024-11-22 05:56:15 +02:00
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 <git@JohnEricson.me>
This commit is contained in:
parent
da92ad7dd2
commit
bf72b78ef2
1 changed files with 2 additions and 2 deletions
|
@ -202,14 +202,14 @@ For example, here is a Python script that depends on Python and the
|
||||||
|
|
||||||
```python
|
```python
|
||||||
#! /usr/bin/env nix-shell
|
#! /usr/bin/env nix-shell
|
||||||
#! nix-shell -i python --packages python pythonPackages.prettytable
|
#! nix-shell -i python3 --packages python3 python3Packages.prettytable
|
||||||
|
|
||||||
import prettytable
|
import prettytable
|
||||||
|
|
||||||
# Print a simple table.
|
# Print a simple table.
|
||||||
t = prettytable.PrettyTable(["N", "N^2"])
|
t = prettytable.PrettyTable(["N", "N^2"])
|
||||||
for n in range(1, 10): t.add_row([n, n * n])
|
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
|
Similarly, the following is a Perl script that specifies that it
|
||||||
|
|
Loading…
Reference in a new issue