Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I import non namespaced types into IronPython?

I have a C# .NET classes that exist outside of a namespace that need to be accessed inside of IronPython. Typically I would do:

import SomeNamespace
from SomeNamespace import *

However, I do not have a namespace.

like image 795
LunchMarble Avatar asked Oct 07 '22 01:10

LunchMarble


1 Answers

Import your assembly like usual, then just import the class name:

import clr
clr.AddReference("MyAssembly") 
import MyGlobalClass
like image 167
peacemaker Avatar answered Oct 13 '22 11:10

peacemaker