Hi. Help pls. Embedding PyPy in C++ but tkinter gives an error

yaşar tecer <[email protected]>
Newsgroups gmane.comp.python.pypy
Message-ID <CA+5XQfhfa9qUkRb7JV8PQNnHaKYu36Gr24ymhd1zM4dYruwUgw@mail.gmail.com>
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

_______________________________________________
pypy-dev mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-dev
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.