Python Forum
Embedding Python into a simulator
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?
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
Question Embedding a python file online Dreary35 0 195 Jun-10-2021, 05:05 PM
Last Post: Dreary35
  Embedding python cause crash when use boost::asio multi threading udvatt108 0 533 Oct-04-2020, 03:15 PM
Last Post: udvatt108
  Need help merging/embedding duckredbeard 10 1,051 Aug-13-2020, 04:48 AM
Last Post: duckredbeard
  Embedding return in a print statement Tapster 3 869 Oct-07-2019, 03:10 PM
Last Post: Tapster
  Calling Extended Embedding Python as shared library jibarra 0 913 Jul-19-2019, 05:22 PM
Last Post: jibarra
  More Python Embedding Trouble jibarra 3 1,135 Jul-11-2019, 09:25 PM
Last Post: Gribouillis
  Python Embedding jibarra 4 1,334 Jul-11-2019, 03:25 PM
Last Post: jibarra
  elevator simulator...whats the wrong at this code? tasos710 5 2,838 Jun-11-2019, 01:38 AM
Last Post: micseydel
  Embedding, windows, and virtual environments mariofutire 0 1,488 Sep-14-2018, 10:30 AM
Last Post: mariofutire
  The graphic/simulator is not loading in OOP version Caturix99 5 2,039 Sep-05-2018, 08:54 PM
Last Post: Gribouillis

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020