diff --git a/latest/.doctrees/commands/console.doctree b/latest/.doctrees/commands/console.doctree index 7136e30e2e..558b27c8f3 100644 Binary files a/latest/.doctrees/commands/console.doctree and b/latest/.doctrees/commands/console.doctree differ diff --git a/latest/.doctrees/commands/networks.doctree b/latest/.doctrees/commands/networks.doctree index d721f8b4f1..e8eb04002e 100644 Binary files a/latest/.doctrees/commands/networks.doctree and b/latest/.doctrees/commands/networks.doctree differ diff --git a/latest/.doctrees/environment.pickle b/latest/.doctrees/environment.pickle index c558e73645..7e0177c634 100644 Binary files a/latest/.doctrees/environment.pickle and b/latest/.doctrees/environment.pickle differ diff --git a/latest/.doctrees/methoddocs/ape.doctree b/latest/.doctrees/methoddocs/ape.doctree index 04ef2b68b3..62f0f286c3 100644 Binary files a/latest/.doctrees/methoddocs/ape.doctree and b/latest/.doctrees/methoddocs/ape.doctree differ diff --git a/latest/.doctrees/methoddocs/ape_ethereum.doctree b/latest/.doctrees/methoddocs/ape_ethereum.doctree index 82f5ec3df0..7c3c8d2f90 100644 Binary files a/latest/.doctrees/methoddocs/ape_ethereum.doctree and b/latest/.doctrees/methoddocs/ape_ethereum.doctree differ diff --git a/latest/.doctrees/methoddocs/ape_node.doctree b/latest/.doctrees/methoddocs/ape_node.doctree index 63f8540377..f40fada2c7 100644 Binary files a/latest/.doctrees/methoddocs/ape_node.doctree and b/latest/.doctrees/methoddocs/ape_node.doctree differ diff --git a/latest/.doctrees/methoddocs/api.doctree b/latest/.doctrees/methoddocs/api.doctree index 078cec5093..a862cbef2b 100644 Binary files a/latest/.doctrees/methoddocs/api.doctree and b/latest/.doctrees/methoddocs/api.doctree differ diff --git a/latest/.doctrees/methoddocs/cli.doctree b/latest/.doctrees/methoddocs/cli.doctree index df4bda55d0..11d0f1486b 100644 Binary files a/latest/.doctrees/methoddocs/cli.doctree and b/latest/.doctrees/methoddocs/cli.doctree differ diff --git a/latest/.doctrees/methoddocs/contracts.doctree b/latest/.doctrees/methoddocs/contracts.doctree index d640ca7b4a..f8c67238d9 100644 Binary files a/latest/.doctrees/methoddocs/contracts.doctree and b/latest/.doctrees/methoddocs/contracts.doctree differ diff --git a/latest/.doctrees/methoddocs/exceptions.doctree b/latest/.doctrees/methoddocs/exceptions.doctree index 01e83fcbc7..dde5657845 100644 Binary files a/latest/.doctrees/methoddocs/exceptions.doctree and b/latest/.doctrees/methoddocs/exceptions.doctree differ diff --git a/latest/.doctrees/methoddocs/managers.doctree b/latest/.doctrees/methoddocs/managers.doctree index 3c1699ab69..7fe7a1ab7c 100644 Binary files a/latest/.doctrees/methoddocs/managers.doctree and b/latest/.doctrees/methoddocs/managers.doctree differ diff --git a/latest/.doctrees/methoddocs/plugins.doctree b/latest/.doctrees/methoddocs/plugins.doctree index e42c2cda22..446f1b9d58 100644 Binary files a/latest/.doctrees/methoddocs/plugins.doctree and b/latest/.doctrees/methoddocs/plugins.doctree differ diff --git a/latest/.doctrees/methoddocs/types.doctree b/latest/.doctrees/methoddocs/types.doctree index 93e9305f8b..4c0c8a22aa 100644 Binary files a/latest/.doctrees/methoddocs/types.doctree and b/latest/.doctrees/methoddocs/types.doctree differ diff --git a/latest/.doctrees/methoddocs/utils.doctree b/latest/.doctrees/methoddocs/utils.doctree index 8c3991c54f..8f918e9c3d 100644 Binary files a/latest/.doctrees/methoddocs/utils.doctree and b/latest/.doctrees/methoddocs/utils.doctree differ diff --git a/latest/.doctrees/userguides/console.doctree b/latest/.doctrees/userguides/console.doctree index e43e822a40..3ccbfa5f17 100644 Binary files a/latest/.doctrees/userguides/console.doctree and b/latest/.doctrees/userguides/console.doctree differ diff --git a/latest/_sources/userguides/console.md.txt b/latest/_sources/userguides/console.md.txt index b9d8690d94..27b6cf62a2 100644 --- a/latest/_sources/userguides/console.md.txt +++ b/latest/_sources/userguides/console.md.txt @@ -164,3 +164,18 @@ Out[3]: '0.00040634 ETH' In [4]: %bal 0xE3747e6341E0d3430e6Ea9e2346cdDCc2F8a4b5b Out[4]: '0.00040634 ETH' ``` + +## Executing Code + +You can also use the `ape console` to execute programs directly from strings. +This is similar to the `python -c|--code` option except it will display the output cell. +Anything available in `ape console` is also available in `ape console --code`. + +```shell +ape console -c 'project.name' +Out[1]: 'my-project' +ape console -c 'x = 3\nx + 1' +Out[1]: 4 +ape console -c 'networks.active_provider.name' +Out[1]: 'test' +``` diff --git a/latest/commands/console.html b/latest/commands/console.html index 38a554054b..01ec3e2646 100644 --- a/latest/commands/console.html +++ b/latest/commands/console.html @@ -172,6 +172,12 @@
One of ERROR, WARNING, SUCCESS, INFO, or DEBUG
Program passed in as a string
+Filter the results by network
mainnet-fork | mainnet | holesky-fork | sepolia-fork | local | sepolia | holesky
+holesky-fork | mainnet-fork | sepolia-fork | sepolia | mainnet | local | holesky
Filter the results by provider
test | node
+node | test
Configure your node:
in Ape, the default provider
plugin for live-network nodes. Also, ape node
can
start-up a local development node for testing purposes.
You can also use the ape console
to execute programs directly from strings.
+This is similar to the python -c|--code
option except it will display the output cell.
+Anything available in ape console
is also available in ape console --code
.
ape console -c 'project.name'
+Out[1]: 'my-project'
+ape console -c 'x = 3\nx + 1'
+Out[1]: 4
+ape console -c 'networks.active_provider.name'
+Out[1]: 'test'
+