Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2011-09-08 14:15:27 +0400
committerCampbell Barton <ideasman42@gmail.com>2011-09-08 14:15:27 +0400
commit49547241d607d902e1a6a76e788580303cb65653 (patch)
tree017c9f306e0074c0ce6c8dce56c0b3a887c0e342
parent9e9fbd371ef2a6e074dabbda84513e4591c266a3 (diff)
correction to docs.
-rw-r--r--doc/python_api/rst/info_tips_and_tricks.rst7
1 files changed, 4 insertions, 3 deletions
diff --git a/doc/python_api/rst/info_tips_and_tricks.rst b/doc/python_api/rst/info_tips_and_tricks.rst
index 00766508056..bd3ed196193 100644
--- a/doc/python_api/rst/info_tips_and_tricks.rst
+++ b/doc/python_api/rst/info_tips_and_tricks.rst
@@ -31,6 +31,7 @@ Blenders text editor is fine for small changes and writing tests but its not ful
Editing a text file externally and having the same text open in blender does work but isn't that optimal so here are 2 ways you can easily use an external file from blender.
+Using the following examples you'll still need textblock in blender to execute, but reference an external file rather then including it directly.
Executing External Scripts
--------------------------
@@ -163,7 +164,7 @@ In the middle of a script you may want to inspect some variables, run some funct
.. code-block:: python
import code
- code.interact(locals=locals())
+ code.interact(local=locals())
If you want to access both global and local variables do this...
@@ -173,14 +174,14 @@ If you want to access both global and local variables do this...
import code
namespace = globals().copy()
namespace.update(locals())
- code.interact(locals=namespace)
+ code.interact(local=namespace)
The next example is an equivalent single line version of the script above which is easier to paste into you're code:
.. code-block:: python
- __import__('code').interact(locals={k: v for ns in (globals(), locals()) for k, v in ns.items()})
+ __import__('code').interact(local={k: v for ns in (globals(), locals()) for k, v in ns.items()})
`code.interact` can be added at any line in the script and will pause the script an launch an interactive interpreter in the terminal, when you're done you can quit the interpreter and the script will continue execution.