I am trying to write a simple C extension for Python3, and it segfaults when I try to add a string to a dictionary. Here is my code:
#include #in
You forgot to initialize the interpreter:
Py_Initialize();
A program that embeds Python must initialize the interpreter before attempting to call any Python functions. This is not necessary for extension modules, which are loaded by an already-initialized interpreter.