2007年12月12日 星期三 11:10
±ÏÒµÉè¼ÆÏë×öÒ»¸öPythonµÄÀ©Õ¹£¬²»¹ýÌÖÂÛºóÒâ¼ûÊÇ·¢±íÂÛÎÄÖ®ÀàµÄ²»Ì«ºÏÊÊ¡£¾ÍÄóö
À´¸ø´ó¼Ò·ÖÏíһϣ¬¹©ÓéÀÖºÍѧϰ֮Óðɡ£
ÏîÄ¿£º»ùÓÚ¶¯Ì¬Óï·¨µÄPython-PythonDIY
ÄÚÈÝ£ºÌá³ö¶¯Ì¬Óï·¨¿ò¼Ü£¬¼òµ¥µÄ˵¾ÍÊÇ¿ÉÒÔ½ÏΪ¼òµ¥ºÍ×ÔÓɵØÐÞ¸ÄPythonÓï·¨´Ó¶øÄÜ
±àÒëеÄÓ﷨дµÄ´úÂëΪPython×Ö½ÚÂë¡£
°ÑPythonµÄÓï·¨²¿·Ö³éÈ¡³öÀ´ÌáÈ¡ÁËÒ»¸öBNFµÄÓï·¨ÃèÊöÎļþºÍÒ»¸öÏà¹ØÁªµÄ
ÓÃÀ´±àÒëµÄ¶¯Ì¬Á´½Ó¿â¡£Í¨¹ýÔÚÔ´´úÂëÖÐÖ¸¶¨²»Í¬µÄÓï·¨À´±àÒ벻ͬµÄÓï·¨¡£
Ä¿±ê£º×îÖÕÏë·¨ÊÇÄܱàÒëC++¡¢java´úÂëÖ®ÀàµÄ£¬»òÐíÓÐÐËȤµÄ»¹¿ÉÒÔÖÐÎıà³Ì£¬Æ½Ê±
¸öÈ˸ù¾Ý°®ºÃÉÔ΢ÐÞ¸ÄһϾͿÉÒÔÓÃÐÂÓï·¨£¬ÓеãÏñ¡£NetµÄͨÓÃÔËÐÐʱ£¬¾ÍÊÇÐ޸ĸü
¶¯Ì¬¡£
ÏÖÔÚÓÐÁ˸ö°ë³ÉÆ·£¬±È½Ï´ó£¬»¹ÓÐÔ´´úÂ룬×öÁËЩÐÞ¸ÄÁбíÖ®ÀàµÄ£¬²»ÊǺÜÏ꾡£¬ËÏë
ÒªµÄ»°µ¥¶À·¢ÎÒÐÅ£¬»òÕßQQ87517411
°ë³ÉÆ·¿ÉÒÔ±àÒëÏÂÃæµÄ¶«Î÷£º
////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////
#grammar=PyGrammarC
//this is a C lauguage test
print "I am one line comment";
/* the print
test*/
print "I am multi-line comment";
a = 0;
b = 1;
c = 2;
print "I am = operation";
if(a == 0) print "I am C-if stmt";
if(a == 3) print "I am C-if stmt";
else if (b == 1)
print "I am C-else if stmt";
else
print "I am C-else stmt";
while(a<1)
{
a = a+1;
print "I am C-while stmt";
}
do{
a = a+1;
print "I am C-dowhile stmt";
}while(a<2)
if(a == 0)
;
print "begin import";
import test;
print "import end";
if(a == 3)
print "I am C-if stmt";
else if (b == 2)
print "I am C-if stmt";
else
print "I am C-if stmt";
////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////
////////////////////////////////
ÆäÖÐtest.py ÊÇÔ PythonÓ﷨дµÄ£¬Ö»ÊÇÔÚµÚÒ»ÐÐÖ¸¶¨ÁË#grammar=PyGrammar
µ¥¶ÀÐÞ¸ÄBNFµÄÓï·¨ÃèÊöÎļþ¿ÉÒÔ½øÐÐijЩ¼òµ¥Ð޸쬱ÈÈçÐÞ¸Ä×¢ÊÍ·û£¬Ð޸Ĺؼü×Ö£¬
¸Ä±äÓï·¨½á¹¹Ö®ÀàµÄ¡£
ÒòΪÊǰë³ÉÆ·£¬×öµÃ»¹²»¹»Ï¸£¬½ö½öÐÞ¸ÄÁËifÓï¾äºÍwhileÓï¾ä£¬Ìí¼ÓÁËdowhileÓï¾ä¡£
Èç¹ûÓÐÓï·¨Ïà¹ØµÄÎÊÌâ¿ÉÒÔÉÔ΢°ïÖúÌÖÂÛһϣ¬ÒòΪʱ¼ä±È½ÏÉÙ£¬Ã¦ÓÚѰÕÒÏÂÒ»¸ö±ÏÉè
ÌâÄ¿T.T
-------------- 下一部分 --------------
Ò»¸öHTML¸½¼þ±»ÒƳý...
URL: http://python.cn/pipermail/python-chinese/attachments/20071212/c5e96527/attachment-0001.htm
2007年12月12日 星期三 11:50
让我想到PYPY 在 07-12-12,cacofish<cacofish在163.com> 写道: > > > > > 毕业设计想做一个Python的扩展,不过讨论后意见是发表论文之类的不太合适。就拿出来给大家分享一下,供娱乐和学习之用吧。 > > > > 项目:基于动态语法的Python-PythonDIY
2007年12月13日 星期四 11:59
首先对LZ赞一个! 看起来对py内部运行机制了解的比较透彻。真希望我也有这样的水平 不过我觉得用来学习也好,研究也好, 更重要的是要考虑是不是可以用来生产! py可不只是来玩的,而是要拿来用的 On Dec 12, 2007 11:50 AM, vicalloy <zbirder at gmail.com> wrote: > 让我想到PYPY > > 在 07-12-12,cacofish<cacofish at 163.com> 写道: > > > > > > > > > > 毕业设计想做一个Python的扩展,不过讨论后意见是发表论文之类的不太合适。就拿出来给大家分享一下,供娱乐和学习之用吧。 > > > > > > > > 项目:基于动态语法的Python-PythonDIY > _______________________________________________ > python-chinese > Post: send python-chinese at lists.python.cn > Subscribe: send subscribe to python-chinese-request at lists.python.cn > Unsubscribe: send unsubscribe to python-chinese-request at lists.python.cn > Detail Info: http://python.cn/mailman/listinfo/python-chinese -- 关注LAMP平台、安全、及web开发的个人blog: http://hackgou.itbbq.com PGP KeyID: hackgou#Gmail.com PGP KeyServ: subkeys.pgp.net
Zeuux © 2025
京ICP备05028076号