How to call a C# code from python
The short answer would be
os.system("myapp.exe")
How to load a C# dll in python?
This is to answer the second part of your Question
Try making the DLL COM visible.
by using the
[ComVisible(true)]
Ok IronPython is a .net implemenatation of the Python language
The technology is going to use the DLR of the .net 4.0 when it arrives so IronPython will have more Dynamism (is that a word).
(In english if you're a Python guru, you'll feel more at home when you use IronPython)
So you may well choose IronPython, if you do that you can skip the COM visible part. Since both (C# , Iron Python) are under .Net
http://ironpython.net/
Calling C# code from python using pythonnet
I should admit that pythonnet is not supposed to crash CPython interpreter even on this bad example of generic call with invalid arguments to the method.
Here is how to properly make your generic calls with pythonnet, notice how passing wrong types fails properly:
In [3]: NonGenericClass.GenericMethod[Person](TempGenericClass[Person]())
In [4]: NonGenericClass.GenericMethod[Employee](TempGenericClass[Employee]())
In [5]: NonGenericClass.GenericMethod[Person](TempGenericClass[Employee]())
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
<ipython-input-5-d13751f7586f> in <module>()
----> 1 NonGenericClass.GenericMethod[Person](TempGenericClass[Employee]())
TypeError: No method matches given arguments
In [6]: NonGenericClass.GenericMethod[Employee](TempGenericClass[Person]())
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
<ipython-input-6-04c3c0db6c6b> in <module>()
----> 1 NonGenericClass.GenericMethod[Employee](TempGenericClass[Person]())
TypeError: No method matches given arguments
Related Topics
HTML Table (Text) to Image Using C#
Does C# Have an Equivalent to JavaScript's Encodeuricomponent()
Send Email Using System.Net.Mail Through Gmail
Data Binding in Wpf User Controls
C# Reflection - Get Field Values from a Simple Class
Establish a Link Between Two Lists in Linq to Entities Where Clause
How to Make the Return Type of a Method Generic
How to Send HTML-Formatted Email
JavaScript Date to C# via Ajax
What Are Checked Exceptions in Java/C#
Mutating the Expression Tree of a Predicate to Target Another Type
Use Linq to Group a Sequence of Numbers with No Gaps
Drag and Drop to Desktop/Explorer
System.Text.JSON: How to Specify a Custom Name for an Enum Value