Macaulay2 » Documentation
Packages » Python » runSimpleString
next | previous | forward | backward | up | index | toc

# runSimpleString -- execute Python source code from a string in __main__

- Usage:
    `runSimpleString s`
- Inputs:
  - s, a string, containing Python source code;

## Description

This function a is wrapper around the function PyRun_SimpleString from the Python C API. Note that, unlike pythonValue, it has no return value.

    i1 : runSimpleString "print('Hello, world!')"

## See also

- pythonValue -- execute Python source code from a string
- pythonRunScript -- execute a sequence of Python statements

## For the programmer

The object runSimpleString is a compiled function.

The source of this document is in /build/macaulay2-88fgJW/macaulay2-1.25.11+ds/M2/Macaulay2/packages/Python/doc.m2:230:0.