summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorkat <katherine@vector35.com>2022-06-21 11:49:51 -0400
committerkat <katherine@vector35.com>2022-06-21 11:50:06 -0400
commit34e5803d69fea165da55da518ffaddfb7344ed00 (patch)
tree67df4c9d00ee8d6e752537bcc5e4198f6680dad0 /docs
parentae4bf47445f675efdbae9ea87bc036f59e9cca0b (diff)
'Run Script...' fixes and documentation
Diffstat (limited to 'docs')
-rw-r--r--docs/getting-started.md14
1 files changed, 14 insertions, 0 deletions
diff --git a/docs/getting-started.md b/docs/getting-started.md
index 4ef85a95..06acfe94 100644
--- a/docs/getting-started.md
+++ b/docs/getting-started.md
@@ -520,6 +520,20 @@ The python interpreter can be customized to run scripts on startup using `startu
From here, you can add any custom functions or objects you want to be available in the console. If you want to restore the original copy of `startup.py` at any time, simply delete the file and restart Binary Ninja. A fresh copy of the above will be generated.
+#### "Run Script..."
+
+The "Run Script..." option in the File Menu allows loading a python script from your filesystem and executing it
+within the console. It can also be ran via the Command Palette or bound to a key.
+
+The script will have access to the same variables the Python console does, including the built-in special functions and
+variables defined by BinaryNinja, and any variables you have already defined within the console. It may be helpful to
+think of it as an equivalent to pasting the contents of the script within the console.
+
+While `__name__` in the console is set to `'__console__'`, within a script it will be set to `'__main__'`. `__file__` is not
+defined within the console, but within the script, it will be set to the absolute path of the script.
+
+Any variables or functions defined globally within the script will be available within the console, and to future scripts.
+
#### Python Debugging
See the [plugin development guide](dev/plugins.md#debugging-python).