2012-07-14

Cpy – Wrting Python in C Syntax

Views: 12699 | Add Comments

Cpy is a C-like scripting language. It is based on Python runtime, and inherits all Python(Python 2.*)’s type system. So you can write script in C syntax, and also have the powerfull Python Engine!

Documents and Downloads: http://www.ideawu.com/cpy/

A Hello World of Cpy –

class A{
	public a = 0;
	public static s = 1;
	
	function init(a){
		this.a = a;
		print 'A init', a;
	}

	function f(a, b=1){
		return a + b;
	}
}

print A.s; // 1
a = new A(1); // A init 1
print a.f(1, 2); // 3
Posted by ideawu at 2012-07-14 18:40:43

Leave a Comment