[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [40039] trunk/blender/doc/python_api/rst/ info_tips_and_tricks.rst: correction to docs.
Campbell Barton
ideasman42 at gmail.com
Thu Sep 8 12:15:27 CEST 2011
Revision: 40039
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=40039
Author: campbellbarton
Date: 2011-09-08 10:15:27 +0000 (Thu, 08 Sep 2011)
Log Message:
-----------
correction to docs.
Modified Paths:
--------------
trunk/blender/doc/python_api/rst/info_tips_and_tricks.rst
Modified: trunk/blender/doc/python_api/rst/info_tips_and_tricks.rst
===================================================================
--- trunk/blender/doc/python_api/rst/info_tips_and_tricks.rst 2011-09-08 10:06:28 UTC (rev 40038)
+++ trunk/blender/doc/python_api/rst/info_tips_and_tricks.rst 2011-09-08 10:15:27 UTC (rev 40039)
@@ -31,6 +31,7 @@
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 @@
.. 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 @@
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.
More information about the Bf-blender-cvs
mailing list