All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
pyInterpreter.h
Go to the documentation of this file.
1//
2// Copyright 2016 Pixar
3//
4// Licensed under the terms set forth in the LICENSE.txt file available at
5// https://openusd.org/license.
6//
7#ifndef PXR_BASE_TF_PY_INTERPRETER_H
8#define PXR_BASE_TF_PY_INTERPRETER_H
9
12
13#include "pxr/pxr.h"
14
15#include "pxr/base/tf/api.h"
16#include "pxr/external/boost/python/handle.hpp"
17#include "pxr/external/boost/python/object.hpp"
18#include <string>
19
20PXR_NAMESPACE_OPEN_SCOPE
21
28TF_API
29extern void TfPyInitialize();
30
39TF_API
40extern int TfPyRunSimpleString(const std::string & cmd);
41
56TF_API
57extern pxr_boost::python::handle<>
58TfPyRunString(const std::string & cmd, int start,
59 pxr_boost::python::object const &globals = pxr_boost::python::object(),
60 pxr_boost::python::object const &locals = pxr_boost::python::object()
61 );
62
77TF_API
78extern pxr_boost::python::handle<>
79TfPyRunFile(const std::string &filename, int start,
80 pxr_boost::python::object const &globals = pxr_boost::python::object(),
81 pxr_boost::python::object const &locals = pxr_boost::python::object()
82 );
83
84PXR_NAMESPACE_CLOSE_SCOPE
85
86#endif // PXR_BASE_TF_PY_INTERPRETER_H
TF_API int TfPyRunSimpleString(const std::string &cmd)
Runs the given string using PyRun_SimpleString().
TF_API pxr_boost::python::handle TfPyRunString(const std::string &cmd, int start, pxr_boost::python::object const &globals=pxr_boost::python::object(), pxr_boost::python::object const &locals=pxr_boost::python::object())
Runs the given string using PyRun_String().
TF_API void TfPyInitialize()
Starts up the python runtime.
TF_API pxr_boost::python::handle TfPyRunFile(const std::string &filename, int start, pxr_boost::python::object const &globals=pxr_boost::python::object(), pxr_boost::python::object const &locals=pxr_boost::python::object())
Runs the given file using PyRun_File().