diff options
author | Siddarth Suresh <155843085+SiddarthSuresh98@users.noreply.github.com> | 2025-03-02 20:35:40 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-03-02 20:35:40 -0500 |
commit | b88f24b680be34b3669f33214758c76439d7b777 (patch) | |
tree | b9815d43d79b631939cd531512b470829ba16436 /src/rv.cc | |
parent | 3fbe74a1067a6e94d62a53d4df834ff425c2c64a (diff) | |
parent | a9af4fd3243e470ff33d50968f998bf78c152717 (diff) |
Merge pull request #8 from bdunahu/bdunahu
Added logger class, tests, arg parsing and cleanup
Diffstat (limited to 'src/rv.cc')
-rw-r--r-- | src/rv.cc | 33 |
1 files changed, 0 insertions, 33 deletions
diff --git a/src/rv.cc b/src/rv.cc deleted file mode 100644 index 02d95e2..0000000 --- a/src/rv.cc +++ /dev/null @@ -1,33 +0,0 @@ -#include <Python.h> -#include <iostream> - -int main() { - Py_Initialize(); - PyRun_SimpleString("import sys; sys.path.append('src/')"); - PyObject *pName = PyUnicode_DecodeFSDefault("repl.repl"); - PyObject *pModule = PyImport_Import(pName); - Py_DECREF(pName); - - if (pModule != nullptr) { - PyObject *pFunc = PyObject_GetAttrString(pModule, "start"); - if (pFunc && PyCallable_Check(pFunc)) { - PyObject *pArgs = PyTuple_Pack(1, PyUnicode_FromString("World")); - PyObject *pValue = PyObject_CallObject(pFunc, pArgs); - Py_DECREF(pArgs); - if (pValue != nullptr) { - std::cout << PyUnicode_AsUTF8(pValue) << std::endl; - Py_DECREF(pValue); - } else { - PyErr_Print(); - std::cerr << "Call failed" << std::endl; - } - Py_DECREF(pFunc); - } - Py_DECREF(pModule); - } else { - PyErr_Print(); - std::cerr << "Failed to load \"hello\"" << std::endl; - } - Py_Finalize(); - return 0; -} |