Howdy gents,
I'm hosting my IronPython in a C# webapp like so:
var engine = Python.CreateEngine();
var scope = engine.CreateScope();
var script = Engine.CreateScriptSourceFromString(pythonCode, SourceCodeKind.Statements);
script.Execute(scope);
And my python code looks like this:
import clr
clr.AddReference('System.Core')
from System import DateTime
theDate = DateTime.Today()
Which tells me to f**k right off:
IronPython.Runtime.Exceptions.ImportException: Cannot import name DateTime
I've spent some time on Google and most of the code I found doesn't seem to work anymore.
My IronPython Runtime Version is v2.0.50727 - should I be upgrading? I'd have thought DateTime would've been in from early doors though?
Anthony