Bottom Page

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
 Embedding Python into a simulator
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?

Top Page

Possibly Related Threads...
Thread Author Replies Views Last Post
  Embedding return in a print statement Tapster 3 262 Oct-07-2019, 03:10 PM
Last Post: Tapster
  Calling Extended Embedding Python as shared library jibarra 0 368 Jul-19-2019, 05:22 PM
Last Post: jibarra
  More Python Embedding Trouble jibarra 3 503 Jul-11-2019, 09:25 PM
Last Post: Gribouillis
  Python Embedding jibarra 4 572 Jul-11-2019, 03:25 PM
Last Post: jibarra
  elevator simulator...whats the wrong at this code? tasos710 5 1,630 Jun-11-2019, 01:38 AM
Last Post: micseydel
  Embedding, windows, and virtual environments mariofutire 0 862 Sep-14-2018, 10:30 AM
Last Post: mariofutire
  The graphic/simulator is not loading in OOP version Caturix99 5 1,197 Sep-05-2018, 08:54 PM
Last Post: Gribouillis
  [CPP] Embedding Python and use GDB Razazel 4 1,981 Nov-12-2017, 05:59 PM
Last Post: Razazel

Forum Jump:

Users browsing this thread: 1 Guest(s)