[pypy-dev] Hi. Help pls. Embedding PyPy in C++ but tkinter gives an error

yaşar tecer yasartecer.tr at gmail.com
Thu Jan 21 16:26:36 EST 2021


I Embedding PyPy in C++. Everything works fine. But when I import the
tkinter module, I get an error. I am compiling the code in visual studio
2019. Sample code:

#include <PyPy.h>#include <stdio.h>
int main(){
  int res;

  rpython_startup_code();
  pypy_setup_home("C:\\pypy37\\",1);
  res = pypy_execute_source("import math ; print (math.pow(2,3)) ");
  pypy_init_threads();

  return res;
}

PS C:\Users\.....\x64\Debug> ./pypyrun.exe8.0

The above code works without errors. But, the code below fails. The
imported tkinter module is generating an error.

#include <PyPy.h>#include <stdio.h>
int main(){
  int res;

  rpython_startup_code();
  pypy_setup_home("C:\\pypy37\\",1);
  res = pypy_execute_source("from tkinter import *;window =
Tk();window.mainloop() ");
  pypy_init_threads();

  return res;
}

The error output is as follows;

PS C:\Users\.....\x64\Debug> ./pypyrun.exe
debug: OperationError:
debug:  operror-type: IndexError
debug:  operror-value: list index out of range
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.python.org/pipermail/pypy-dev/attachments/20210122/571275ca/attachment.html>


More information about the pypy-dev mailing list