Seg3D  2.4
Seg3D is a free volume segmentation and processing tool developed by the NIH Center for Integrative Biomedical Computing at the University of Utah Scientific Computing and Imaging (SCI) Institute.
All Classes Namespaces Functions Variables Typedefs Enumerator Friends
Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | Friends | List of all members
Core::PythonInterpreter Class Reference
Inheritance diagram for Core::PythonInterpreter:
Core::EventHandler

Public Types

typedef std::pair< std::string, PyObject *(*)(void) > module_entry_type
 
typedef std::list< module_entry_type > module_list_type
 
typedef boost::signals2::signal< void(std::string) > console_output_signal_type
 

Public Member Functions

void initialize (const wchar_t *program_name, const module_list_type &init_list)
 Initialize the python interpreter with extra modules.
 
PythonActionContextHandle get_action_context ()
 Get the action context for running actions from python.
 
void print_banner ()
 Print the basic information about the python interpreter to output_signal_.
 
void run_string (std::string command)
 
void run_script (std::string script)
 
void run_script (StringVectorConstHandle script)
 
void run_file (std::string file_name)
 
void interrupt ()
 Interrupt the current execution.
 
void start_terminal ()
 To be implemented.
 

Static Public Member Functions

static PythonActionContextHandle GetActionContext ()
 Returns the action context for the python interpreter.
 
static std::string EscapeSingleQuotedString (const std::string &input_str)
 

Public Attributes

console_output_signal_type prompt_signal_
 
console_output_signal_type error_signal_
 
console_output_signal_type output_signal_
 

Friends

class ::PythonStdIO
 

Member Function Documentation

std::string Core::PythonInterpreter::EscapeSingleQuotedString ( const std::string &  input_str)
static

Escape the quotes(') and backslashes() in a string so it can be used as a python string enclosed by a pair of single quotes.

void Core::PythonInterpreter::run_file ( std::string  file_name)

Execute a python script from file. NOTE: The script is run in its own local namespace.

void Core::PythonInterpreter::run_script ( std::string  script)

Execute a python script. NOTE: The script is run in its own local namespace.

void Core::PythonInterpreter::run_script ( StringVectorConstHandle  script)

Execute a python script. NOTE: The script is run in its own local namespace.

void Core::PythonInterpreter::run_string ( std::string  command)

Execute a single python command. NOTE: The command is run in the main namespace.


The documentation for this class was generated from the following files: