472,374 Members | 1,239 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,374 software developers and data experts.

c# application calling Scipy

Hi,

Novice here. :)

I'm building a c# application and I want to call functions in SciPy
from that application.

What's the best way to call SciPy methods from a C# program?

Is there a best Python implementation for this? Ironython? Python for
..NET? Enthought?

Thanks in advance,
Don

Jan 6 '07 #1
2 5242
do********@hotmail.com wrote:
Hi,

Novice here. :)

I'm building a c# application and I want to call functions in SciPy
from that application.

What's the best way to call SciPy methods from a C# program?

Is there a best Python implementation for this? Ironython? Python for
.NET? Enthought?
scipy is a package with many C and FORTRAN extensions, so IronPython won't work
unless someone has figured out a magic way to compile them. The Enthought
distribution (disclosure: I work for Enthought) is just a bundling of the normal
python.org distribution of Python with a bunch of packages; it knows nothing
about C#. I know little about Python for .NET beyond its README, but it does
seem to be able to embed CPython into a C# application and with some elbow
grease, that might work for you.

--
Robert Kern

"I have come to believe that the whole world is an enigma, a harmless enigma
that is made terrible by our own mad attempt to interpret it as though it had
an underlying truth."
-- Umberto Eco

Jan 6 '07 #2

do********@hotmail.com wrote:
Hi,

Novice here. :)

I'm building a c# application and I want to call functions in SciPy
from that application.

What's the best way to call SciPy methods from a C# program?
You need to:

1. Embed a Python interpreter in your C# app. That is, importing from a
DLL with a Python interpreter and defining a few structs.

2. Define a NumPy ndarray as a C# struct.

Or:

1. Write a proxy DLL in C and embed Python in that. This is the
preferred way, as I see it. You are relieved of having to redefine
Python and NumPy's C structs in C#.

2. Import your proxy in C# and marshal a C# array to a IntPtr. That
will allow you to map a C# array to a NumPy ndarray C struct in your
proxy.

The latter method is less hassle.

In any case you also need to make sure you are using a .NET runtime
that are linked to the same CRT as Python (.NET 1.1 should work).

Using IronPython will not work, as neither NumPy nor SciPy is ported to
IronPython (and porting is not trivial either; but if you take the task
upon yourself, many will be happy if you succeeed.)

Jan 7 '07 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: avik | last post by:
Hi. I need to use SciPy (a library of scientific tools for python) but I runned upon a problem after installing it. I downloaded the binaries from scipy.org and copied the contents of the archive...
0
by: mike kreiner | last post by:
I'm using the convolve2d(image, mask) function from scipy to blur an image. The image I'm using is 512 by 384. When I display the image that convolve2d returns, the the left-most square of pixels...
3
by: hawkesed | last post by:
Hi All, has anyone out there recently set up scipy on Windows? Cause I am trying to do so know and I am not having much luck. I have ActiveState and Plone. When I try to import scipy in...
1
by: tkpmep | last post by:
I installed SciPy and NumPy (0.9.5, because 0.9.6 does not work with the current version of SciPy), and had some teething troubles. I looked around for help and observed that the tutorial is dated...
0
by: Julien Fiore | last post by:
Hi, I have problems trying to install the scipy.weave package. I run Python 2.4 on windows XP and my C compiler is MinGW. Below is the output of scipy.weave.test(). I read that the tests should...
2
by: Aage Andersen | last post by:
I am exploring the modules scipy and linalg using python under Win XP and IDLE. Defining m=matrix( .. ) and trying to compute the inverse of m: I get an array: This is unfortunate. I...
1
by: tkpmep | last post by:
I'm trying to optimize a function using SciPy's optimize.fmin, but am clearly getting the syntax wrong, and would be grateful for some guiidance. First, here's the function def func(Y,x): """Y...
2
by: robert | last post by:
I'm using latest numpy & scipy. What is this problem ? : RuntimeError: module compiled against version 1000002 of C-API but this version of numpy is 1000009 Traceback (most recent call last):...
2
by: Peter Maas | last post by:
I tried some scipy examples using scipy 0.52, numpy 1.02 and python 2.5 on a WinXP SP2 machine. numpy.linalg.det() works but scipy.linalg.det() crashes python. Has anybody experienced this and can...
0
by: Naresh1 | last post by:
What is WebLogic Admin Training? WebLogic Admin Training is a specialized program designed to equip individuals with the skills and knowledge required to effectively administer and manage Oracle...
0
by: antdb | last post by:
Ⅰ. Advantage of AntDB: hyper-convergence + streaming processing engine In the overall architecture, a new "hyper-convergence" concept was proposed, which integrated multiple engines and...
0
Oralloy
by: Oralloy | last post by:
Hello Folks, I am trying to hook up a CPU which I designed using SystemC to I/O pins on an FPGA. My problem (spelled failure) is with the synthesis of my design into a bitstream, not the C++...
0
by: Carina712 | last post by:
Setting background colors for Excel documents can help to improve the visual appeal of the document and make it easier to read and understand. Background colors can be used to highlight important...
0
BLUEPANDA
by: BLUEPANDA | last post by:
At BluePanda Dev, we're passionate about building high-quality software and sharing our knowledge with the community. That's why we've created a SaaS starter kit that's not only easy to use but also...
0
by: Rahul1995seven | last post by:
Introduction: In the realm of programming languages, Python has emerged as a powerhouse. With its simplicity, versatility, and robustness, Python has gained popularity among beginners and experts...
2
by: Ricardo de Mila | last post by:
Dear people, good afternoon... I have a form in msAccess with lots of controls and a specific routine must be triggered if the mouse_down event happens in any control. Than I need to discover what...
1
by: Johno34 | last post by:
I have this click event on my form. It speaks to a Datasheet Subform Private Sub Command260_Click() Dim r As DAO.Recordset Set r = Form_frmABCD.Form.RecordsetClone r.MoveFirst Do If...
0
DizelArs
by: DizelArs | last post by:
Hi all) Faced with a problem, element.click() event doesn't work in Safari browser. Tried various tricks like emulating touch event through a function: let clickEvent = new Event('click', {...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.