MCPcopy Create free account
hub / github.com/NatLabRockies/OpenStudio / executePythonRepl

Function executePythonRepl

src/cli/UpdateCommand.cpp:288–298  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

286 }
287
288 void executePythonRepl(ScriptEngineInstance& pythonEngine) {
289 const std::string cmd = R"python(
290import readline # optional, will allow Up/Down/History in the console
291import code
292variables = globals().copy()
293variables.update(locals())
294shell = code.InteractiveConsole(variables)
295shell.interact()
296 )python";
297 pythonEngine->exec(cmd);
298 }
299
300 void executePipListCommand(ScriptEngineInstance& pythonEngine) {
301 // TODO: seems like the CLI is picking up your virtualenvironment, so we manipulate sys.path to keep only the E+ folder for now

Callers 1

mainFunction · 0.85

Calls 1

execMethod · 0.45

Tested by

no test coverage detected