.NET Tools 2005--小气的神

专注于.NET技术,传播.NET技术

IronPython 小试牛角

 

IronPython看来是一个做UnitTest的不错工具,但目前不支持中文J

Filename: HelloWord.cs

using System;

namespace MyTest

{

public class test

{

       public string HelloWord(string Hello)

       {

              return Hello + " This is Test" ;

       }

      

       public string hello2()

       {

              return "This is Test";

       }

}

}

Csc /t:library HelloWord.cs

 

C:\SharpTools\IronPython-0.6\bin>IronPythonConsole.exe

>>> import sys

>>> sys.LoadAssemblyFromFile("Helloword.dll")

>>> from MyTest import *

>>> t = test()

>>> t.hello2

<method# hello2 on MyTest.test>

>>> t.hello2()

'This is Test'

>>> t.HelloWord("OK! ---")

'OK! --- This is Test'

>>> t.HelloWord("中文")

u'\x4e2d\x6587 This is Test'

>>> 

 

有意思J

posted on 2004-09-09 11:28  ccBoy  阅读(1166)  评论(0)    收藏  举报

导航