AnyCmd
Do the provided cell magics not quite fit your needs? AnyCmd is a versatile Jupyter cell magic that allows you to run a cell with any command line utility. Simply specify the command you want to run as arguments after the magic. Access the contents of the cell as a file using the literal string "%FILE" or "%FILE.someExtension"
By default, the command specified after the magic will be run from a temporary working directory. However, you may use -d/--dir to chdir into a custom directory before running the cell command. Use "-d ." to run it in the current working directory.
Use -i/--inplace if you would like to write the cell contents temp files in the specified working directory, rather than the temporary directory (has no effect without --dir). This may help with compilers that reference libraries in the same directory, for instance.
Use "-p/--print" to print command output live, instead of outputting to the cell. This may improve readability, and make it easier to debug long-running commands.
--nonewline prevents adding a newline character before the cell contents in the temporary file to offset the first line taken up by the cell magic in order to fix line numbers from error messages. [Changed in 0.1.4: this is now the default behavior and --lines was removed].
You may install this package via PyPi:
!pip install anycmd-jupyter-magic
%load_ext anycmd
Example (compiling and running c++):
%%any -p -l -- clang++ -O3 %FILE.cpp -o file && ./file
#include <iostream>
using namespace std;
int main(int argc, const char** argv) {
cout << "Hello World\n";
}
Result:
Hello World
Metadata
Release files for anycmd-jupyter-magic 0.1.4
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| anycmd_jupyter_magic-0.1.4.tar.gz | 5.4 kB | Without provenance | Details for anycmd_jupyter_magic-0.1.4.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| anycmd_jupyter_magic-0.1.4-py3-none-any.whl | Python 3 | none | any | Details for anycmd_jupyter_magic-0.1.4-py3-none-any.whl |
Total release size: 11.3 kB
Release files / anycmd_jupyter_magic-0.1.4.tar.gz
| Download URL | anycmd_jupyter_magic-0.1.4.tar.gz |
|---|---|
| Size | 5.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
e1887d46f8ba111503b4d5fb7080573ce86a76bcd7bdf2e9875164d16b303dc6
|
|
BLAKE2b-256 checksum How to use checksums |
c7c223f1fda47d20feb8aa6c17767f44abbd7c008cafe094af27adf130936228
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.11.9
|
Release files / anycmd_jupyter_magic-0.1.4-py3-none-any.whl
| Download URL | anycmd_jupyter_magic-0.1.4-py3-none-any.whl |
|---|---|
| Size | 5.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
a2f8c4688150bf7595e751c1cca5e9b91c8a3c479f547e6d95ee7badb37faf89
|
|
BLAKE2b-256 checksum How to use checksums |
fca6ba01ecf28a9db62a473391f345929043bb6a9255eeabee4557a6b68d5965
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.11.9
|
Security for anycmd-jupyter-magic 0.1.4
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.