boo & python笔记
在这里记录一下,自己的复习所得,有大概一个月没有碰这些东西了,忘的很干净,今天要在C#中集成boo的环境中写点boo的代码,结果一写一个错,在这里记录一下,
如何在boo中使用静态变量
boo版
Code
namespace BooStaticDemo
import System
import System.Collections.Generic
# public class AppConfig
# public static FileName="aa"
print " Hello world! "
# print AppConfig.FileName
// Program goes here
public class Test:
public static name = " aa "
print Test.name;
print " Press any key to continue "
Console.ReadKey()
如何在boo中做条件判断,刚开始这里写好几遍布都错了,python中是or不是C#中的||
Code
namespace test
import System
s = ""
if s == null or s = "" :
Console.WriteLine( " is null or empty " )
else :
Console.WriteLine( " not null or empty " )
Console.ReadLine()
namespace test
import System
import System.Collections
ht = Hashtable()
ht.Add( " 11 " , " ddd " )
print ht
print ht[ " 11 " ]