\pyb commands are executed via a Python script. The
pyconsole environment is executed in a console emulation. So there isn't overlap between the two, and variables aren't shared. (Regular Python commands/environments always start with
py, while everything console-related starts with
You probably want to look into the
\pyconc commands. The first is used for getting the value of a variable, while the second allows you to run console code without showing anything. There is currently not a
\pyconb. My reasoning is that showing code without output isn't console-like. But I might consider adding such a command in the future.