Graphics Reference
In-Depth Information
quences of characters. Because the original assignment of my_variable was a sequence of characters, it was
automatically classified as an object of the string class. Different types can be accessed and dealt with in differ-
ent ways. In the case of the str class, another thing you can ask about it is its length, as follows:
>>> len(my_variable)
12
Direct command-line access can be useful at times for certain things (for example, a bit later in this chapter,
it will provide a convenient way to observe how data types interact).
Accessing the System Console
A very common and important use of the Python shell is as the default output and error report interface for
running scripts. However, when you actually write complete scripts to be executed from the text editor or as
add-ons, the output and error reports will not be sent to the interactive command line. Rather, you'll see your
scripts' output in the System Console (different from the Python Console window.). When you run a script,
this is where the print statements will print to by default, and when the script runs into trouble, this is where
the errors will appear. The System Console interface is output only. Nevertheless, it remains indispensable for
identifying errors.
To access the System Console on Windows, click Toggle System Console under Blender's own Help menu,
as shown in Figure 12-3 . The System Console in Windows is shown in Figure 12-4 .
Figure 12-3 Toggling the System Console in Windows
 
 
Search WWH ::




Custom Search