[IronPython] How do I run python functions and make the python code remember variables between calls from C#?

2009-03-18 Thread BlackMan890
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: ---

Re: [IronPython] How do I run python functions and make the python code remember variables between calls from C#?

2009-03-18 Thread Curt Hagenlocher
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

Re: [IronPython] How do I run python functions and make the python code remember variables between calls from C#?

2009-03-18 Thread BlackMan890
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:

Re: [IronPython] How do I run python functions and make the python code remember variables between calls from C#?

2009-03-18 Thread Dino Viehland
] On Behalf Of BlackMan890 Sent: Wednesday, March 18, 2009 12:48 AM To: users@lists.ironpython.com Subject: [IronPython] How do I run python functions and make the python code remember variables between calls from C#? Hi there. When I run the following .py from C#: --- test.py

Re: [IronPython] How do I run python functions and make the python code remember variables between calls from C#?

2009-03-18 Thread Tim Roberts
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