Hi there.
When I run the following .py from C#:
--- test.py
global crap
crap = None
def set_crap():
crap = yay
def return_crap():
return crap
---
And run the functions set_crap and return_crap from C# using the following
code:
---
Your global statement needs to be inside your set_crap function.
On Wed, Mar 18, 2009 at 12:47 AM, BlackMan890 black...@simnet.is wrote:
Hi there.
When I run the following .py from C#:
--- test.py
global crap
crap = None
def set_crap():
crap = yay
def
Thank you so much :D
It is working now :)
Curt Hagenlocher wrote:
Your global statement needs to be inside your set_crap function.
--
View this message in context:
Hi there.
I was wondering how one would achieve registering a C# function that python
code would be able to call, something like this:
--- test.py ---
def return_crap():
# do something
crap = GetDataFromCSharp()
# do some more
return crap
Create a delegate and set it in the scope prior to executing.
Michael
BlackMan890 wrote:
Hi there.
I was wondering how one would achieve registering a C# function that python
code would be able to call, something like this:
--- test.py ---
def return_crap():
# do
Hi there Michael Foord.
How do I set the delegate inside the scope?
Sincerely:
Jonatan Nilsson
Iceland
Michael Foord wrote:
Create a delegate and set it in the scope prior to executing.
Michael
BlackMan890 wrote:
Hi there.
I was wondering how one would achieve registering a C# function
Hi there.
this has probably been answered before but I cant seem to find the answer.
When I run import time in python through IronPython using C#, an exception
occurs with the message: no module named time.
The same thing happens when I run import threading except with a different
exception: No
These libraries you are attempting to import are Python standard library
modules. To import them you must have the Python standard library
available - and on sys.path for the engine being used to do the imports.
You set sys.path programattically using engine.SetSearchPaths (?)
passing in an
Jonatan Nilsson wrote:
Hi there Michael Foord.
How do I set the delegate inside the scope?
Something like:
var something = delegate(string arg) {
Console.WriteLine(arg);
};
scope.SetVariable(something, something);
HTH
Michael Foord
Sincerely:
Jonatan Nilsson
Iceland
Michael Foord
The documentation for using the hosting APIs is available here:
http://dlr.codeplex.com/Wiki/View.aspx?title=Docs%20and%20specsreferringTitle=Home
as dlr-hosting-spec.doc
-Original Message-
From: users-boun...@lists.ironpython.com [mailto:users-
boun...@lists.ironpython.com] On
Thank you for your quick response.
I tried doing what you asked me.
I added the following to the engine code:
---
ScriptEngine engine = Python.CreateEngine();
engine.SetSearchPaths(new string[] { C:\\Program
Files\\IronPython-2.0.1\\Lib\\, C:\\Python25\\Lib\\ });
Do you have IronPython.Modules.dll next to IronPython.dll?
IronPython.Modules.dll contains the implementation of thread.
-Original Message-
From: users-boun...@lists.ironpython.com [mailto:users-
boun...@lists.ironpython.com] On Behalf Of Jonatan Nilsson
Sent: Wednesday, March 18,
Ok, I figured it out.
I forgot to add C:\\Program Files\\IronPython-2.0.1 and C:\\Python25
Thanks for all the help :D
Jonatan Nilsson wrote:
Thank you for your quick response.
I tried doing what you asked me.
I added the following to the engine code:
---
On Wed, 18 Mar 2009 00:47:30 -0700 (PDT), BlackMan890 black...@simnet.is
Hi there.
When I run the following .py from C#:
--- test.py
global crap
crap = None
def set_crap():
crap = yay
def return_crap():
return crap
---
If you are
Hello guys,
Im trying to import os lib and I get the following error message:
No module named errno
Any ideas?
Thank you
___
Users mailing list
Users@lists.ironpython.com
Hello Antonio,
Can you post the full traceback please?
Michael
António Piteira wrote:
* *
* *
* *
Hello guys,
I’m trying to import os lib and I get the following error message:
“No module named errno”
Any ideas?
Thank you
* *
* *
**
* *
Also make sure you have IronPython.Modules.dll next to IronPython.dll (if
you're hosting IronPython instead of just running from the command line).
-Original Message-
From: users-boun...@lists.ironpython.com [mailto:users-
boun...@lists.ironpython.com] On Behalf Of Michael Foord
Hello Michael,
Thank you for your reply.
I've solved the problem importing nt instead of os.
Thank you!
---
Hello Antonio,
Can you post the full traceback please?
Michael
António Piteira wrote:
* *
* *
* *
18 matches
Mail list logo