diff options
author | Sandro <sandro.jaeckel@gmail.com> | 2021-04-05 05:38:38 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-04-05 05:38:38 +0200 |
commit | 3a6116c550cf36730bcb6ea0212436e7e3c927a7 (patch) | |
tree | 61893fbd5fcba83634c12fc789e6106e7e2e9f34 /doc/languages-frameworks/python.section.md | |
parent | 354703e66fb39a3e33ce998814a8fa46021670d8 (diff) | |
parent | 2c143a461438a4e3c9509222274be819df8d86ef (diff) | |
download | nixpkgs-3a6116c550cf36730bcb6ea0212436e7e3c927a7.tar nixpkgs-3a6116c550cf36730bcb6ea0212436e7e3c927a7.tar.gz nixpkgs-3a6116c550cf36730bcb6ea0212436e7e3c927a7.tar.bz2 nixpkgs-3a6116c550cf36730bcb6ea0212436e7e3c927a7.tar.lz nixpkgs-3a6116c550cf36730bcb6ea0212436e7e3c927a7.tar.xz nixpkgs-3a6116c550cf36730bcb6ea0212436e7e3c927a7.tar.zst nixpkgs-3a6116c550cf36730bcb6ea0212436e7e3c927a7.zip |
Merge pull request #116257 from SuperSandro2000/code-fences
doc/languages-frameworks/*: add missing languages to code fences
Diffstat (limited to 'doc/languages-frameworks/python.section.md')
-rw-r--r-- | doc/languages-frameworks/python.section.md | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/doc/languages-frameworks/python.section.md b/doc/languages-frameworks/python.section.md index 69f17b83e49..96ac61ab54c 100644 --- a/doc/languages-frameworks/python.section.md +++ b/doc/languages-frameworks/python.section.md @@ -79,7 +79,7 @@ $ nix-shell -p 'python38.withPackages(ps: with ps; [ numpy toolz ])' By default `nix-shell` will start a `bash` session with this interpreter in our `PATH`, so if we then run: -``` +```Python console [nix-shell:~/src/nixpkgs]$ python3 Python 3.8.1 (default, Dec 18 2019, 19:06:26) [GCC 9.2.0] on linux @@ -90,7 +90,7 @@ Type "help", "copyright", "credits" or "license" for more information. Note that no other modules are in scope, even if they were imperatively installed into our user environment as a dependency of a Python application: -``` +```Python console >>> import requests Traceback (most recent call last): File "<stdin>", line 1, in <module> @@ -146,8 +146,8 @@ print(f"The dot product of {a} and {b} is: {np.dot(a, b)}") Executing this script requires a `python3` that has `numpy`. Using what we learned in the previous section, we could startup a shell and just run it like so: -``` -nix-shell -p 'python38.withPackages(ps: with ps; [ numpy ])' --run 'python3 foo.py' +```ShellSesssion +$ nix-shell -p 'python38.withPackages(ps: with ps; [ numpy ])' --run 'python3 foo.py' The dot product of [1 2] and [3 4] is: 11 ``` |