Bottom Page

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
 Embedding Python into a simulator
#1
I am trying to embed python in a commercial Discrete Event Simulator (ExtendSim). The simulator offers an extension programming environment which also contains a DLL interface. The simulator is a 64 bit application. My plan is therefore to link to python37.dll, initialize Python and run a function from a python text which is loaded. I managed to get quite far with the initialization part and it seems that the DLL calls work as intended. Still I run into problems with some functions, namely PyTuple_SetItem (used to generate and argument list for the function I want to call) and PyFloat_Check (inserted mainly as a precaution, could be deleted, but should work). The former returns -1, without any obvious reason (the tuple is generated, long enough and I have a pointer which seems valid). The latter crashes the whole simulator (again, the PyFloat is generated and there seems to be a valid pointer). Is there anybody out there with experience from these 'low level' issues? What is wrong and how can it be resolved?
Quote

Top Page

Possibly Related Threads...
Thread Author Replies Views Last Post
  Calling Extended Embedding Python as shared library jibarra 0 179 Jul-19-2019, 05:22 PM
Last Post: jibarra
  More Python Embedding Trouble jibarra 3 247 Jul-11-2019, 09:25 PM
Last Post: Gribouillis
  Python Embedding jibarra 4 289 Jul-11-2019, 03:25 PM
Last Post: jibarra
  elevator simulator...whats the wrong at this code? tasos710 5 829 Jun-11-2019, 01:38 AM
Last Post: micseydel
  The graphic/simulator is not loading in OOP version Caturix99 5 828 Sep-05-2018, 08:54 PM
Last Post: Gribouillis
  [CPP] Embedding Python and use GDB Razazel 4 1,568 Nov-12-2017, 05:59 PM
Last Post: Razazel

Forum Jump:


Users browsing this thread: 1 Guest(s)