Skip to content
Advertisement

Tag: c++

Run python script from C# via command prompt

I’m developing a Winform application. I want to run python script from c# via command prompt (i’m using System.Diagnostics.Process class) I have a function to run python script that need to pass a python script file name. It works correctly until I print a string that contain unicode character. My test.py code contains just a single line. When I compiled

How to set arbitrary size array in ctypes?

So I have a function imported from a .dll library that takes in a pointer to a struct of the form: The idea of function is that if A is NULL, then function(D*) will update A with the size of the required buffer. Hence, if on the other hand B is an array of size A, then function(D*) will return

Forks and Pipes in c++

I am using 4 processes in which A’s output will goto A1 and A1’s output will go to A2 and A2 output will come out in the console. Even A1 output also will comeout in console. 1st program – A C++ program which is a random generator that will generate the output as per the requirements of A1’s input and

Segmentation fault when importing a C++ shared object in Python

I have the following shared object: MyLib.cpp That I compile with: g++ -fPIC -shared -o MyLib.so MyLib.cpp I then use it with the following Python script: script.py Like this, it works perfectly, but if I uncomment the line //var = 10;, Python makes a segmentation fault (Python 3.8). This happens every time the object MyClass makes a change to one

Translating a for loop from c# to python (ironpython) [closed]

Closed. This question needs to be more focused. It is not currently accepting answers. Want to improve this question? Update the question so it focuses on one problem only by editing this post. Closed 2 years ago. Improve this question I’m translating a chunk of code I have to use, from C# to Python. I’m not fluent in C#. How

how to write C++ DLL file for python correctly?

this is my test.cpp file.(I also used makefile to create dll file) when I run following code in python everything is ok and I get this output from python. but when I change my test.cpp in this way(I just uncommented iostream): I get the following error from python. this is also my dependencies enter image description here by the way

Advertisement