Python crash together with threads

2024-10-02 Thread Guenther Sohler via Python-list
My Software project is working fine in most of the cases (www.pythonscad.org) however I am right now isolating a scenario, which makes it crash permanently. It does not happen with Python 3.11.6 (and possibly below), it happens with 3.12 and above It does not happen when not using Threads. Howe

Crash when launching python

2024-09-04 Thread Guenther Sohler via Python-list
Hi, My "Project" is to integrate python support into OpenSCAD. It runs quite well, but there are still issues on MacOS. On My MacOS it works, but it crashes when I ship the DMG files. It looks very much like python is not able to find the "startup" python files and therefore crashes. Is it possi

extend behaviour of assignment operator

2024-01-10 Thread Guenther Sohler via Python-list
Hi, when i run this code a = cube([10,1,1]) b = a i'd like to extend the behaviour of the assignment operator a shall not only contain the cube, but the cube shall also know which variable name it was assigned to, lately. I'd like to use that for improved user interaction. effective code shou

Re: Using my routines as functions AND methods

2024-01-04 Thread Guenther Sohler via Python-list
last): File "", line 8, in TypeError: cannot set 'trans' attribute of immutable type 'PyOpenSCAD' The Problem is probably that PyOpenSCAD is a class not defined on python side but on c++ side, I fear that I need to solution in c++ side. ... On Wed, Jan 3, 20

Re: Using my routines as functions AND methods

2024-01-03 Thread Guenther Sohler via Python-list
as method too, like so: my_object.translate([2,0,0]) WITHOUT duplicating the code for python_translate So the idea is to call the translate-function from within the translate method and insert "self" into the args tuple. However my solution somewhat works but is not very stable and qu

Using my routines as functions AND methods

2024-01-03 Thread Guenther Sohler via Python-list
Hi, In my cpython i have written quite some functions to modify "objects". and their python syntax is e.g.\ translate(obj, vec). e.g whereas obj is ALWAYS first argument. on c side this functions looks like: PyObject *python_translate(PyObject *self, PyObject *args, PyObject *kwargs) this works

Collecting unassigned Expressions

2023-08-24 Thread Guenther Sohler via Python-list
Hi I am wondering If an embedded Python Interpreter can detect unassigned Expressions. Cases where functions Return values but they are Not assignwd. E.g. Calc_square(4) Or 3*4-myval() Thank you for your hints -- https://mail.python.org/mailman/listinfo/python-list

Create Statically linked python library

2023-05-21 Thread Guenther Sohler
Right now my application links python dynamically. That means ldd will show something like libpython3.11.so.1.0 => /lib64/libpython3.11.so.1.0 (0x7fd63c60) but i dont like this dependency. ii want to link in python statically. I'd like to get a file like libpython3.11.a or similar. For t

Embedded python is not 100% stable

2023-04-13 Thread Guenther Sohler
Hi Python LIst, I have been working on adding embedded python into OpenSCAD ( www.openscad.org) for some time already. For that i coded/added an additional Python Type Object which means to hold openscad geometric data. It works quite well but unfortunately its not 100% stable and i have been hea

Python list insert iterators

2023-03-03 Thread Guenther Sohler
Hi Python community, I have a got an example list like 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 T T and i eventually want to insert items in the given locations (A shall go between 2 and 3, B shall go between 6 and 7) Right now i just use index numbers to define the place: A sha