Python Forum
Python C API - Issue with string as arugments
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Python C API - Issue with string as arugments
#2
I have discovered a less efficient workaround.
Output:
I replaced the three calls to SetParameter() with this PyObject * arguments = Py_BuildValue("(sssi)", ipAddress1, ipAddress2, ipAddress3, timeout); PyObject * result = PyObject_CallObject(pyfunction, arguments); // Assuming that pyfunction is already created. // And 'arguments' and 'result' are properly decremented there reference counts.
I would prefer to not deallocate the tuple each time.
Reply


Messages In This Thread
RE: Python C API - Issue with string as arugments - by JRHeisey - Nov-27-2019, 11:55 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Last caracter of a string truncated issue when working from the end of the string Teknohead23 3 1,675 Oct-03-2021, 01:08 PM
Last Post: snippsat
  connection string issue racone 2 3,834 Feb-03-2020, 02:22 AM
Last Post: racone
  List/String seperation issue YoungGrassHopper 13 5,768 Sep-20-2019, 11:57 AM
Last Post: perfringo
  Mixed string,Integer input variable issue maderdash 2 2,830 Nov-06-2018, 09:46 AM
Last Post: snippsat

Forum Jump:

User Panel Messages

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