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


Messages In This Thread
Embedding Python into a simulator - by siggi - Apr-24-2019, 07:42 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Embedding python script into html via pyscript pyscript_dude 7 1,525 Apr-16-2023, 11:17 PM
Last Post: pyscript_dude
  C++ python embedding comarius 0 823 Aug-26-2022, 02:01 AM
Last Post: comarius
Question Embedding a python file online Dreary35 0 1,515 Jun-10-2021, 05:05 PM
Last Post: Dreary35
  Embedding python cause crash when use boost::asio multi threading udvatt108 0 1,714 Oct-04-2020, 03:15 PM
Last Post: udvatt108
  Need help merging/embedding duckredbeard 10 3,370 Aug-13-2020, 04:48 AM
Last Post: duckredbeard
  Embedding return in a print statement Tapster 3 2,265 Oct-07-2019, 03:10 PM
Last Post: Tapster
  Calling Extended Embedding Python as shared library jibarra 0 2,212 Jul-19-2019, 05:22 PM
Last Post: jibarra
  More Python Embedding Trouble jibarra 3 2,904 Jul-11-2019, 09:25 PM
Last Post: Gribouillis
  Python Embedding jibarra 4 3,041 Jul-11-2019, 03:25 PM
Last Post: jibarra
  Embedding or adding IDE like "repl" inside Flask app sray 1 2,211 Jul-03-2019, 03:13 PM
Last Post: nilamo

Forum Jump:

User Panel Messages

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