Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

Python¡¢LuaµÈÓïÑÔÖÐÊÇÈçºÎÅжÏÖ¸ÕëÊÇ·ñÓÐЧµÄ£¿

    Python¡¢LuaµÈ½Å±¾ÓïÑÔÖÐÒ»Çж¼ÊǶÔÏ󣬶ÔÏóÓÃÖ¸Õë±êʶ£¬µ«ÕâЩÓïÑÔÖÐÊÇÈçºÎÅжÏÖ¸ÕëÓÐЧµÄÄØ£¿
    ÀýÈ磬һ¸öº¯ÊýÖÐij¸ö²ÎÊýÊÇÖ¸Õ루ָÏòÒ»¸ö¶ÔÏ󣩣¬ÔÚº¯ÊýµÄÄÚ²¿ÊµÏÖÖУ¬Èç¹ûÖ±½Ó¶ÔÖ¸Õë²Ù×÷£¬¿ÉÄܳöÏÖµÄÎÊÌâÊÇ£º
      1£©Ö¸ÕëÓÐЧ£¬Ôò²Ù×÷³É¹¦¡£
      2£©Ö¸Õë·Ç·¨£¬³ÌÐòÔËÐн«³ö´í¡£
    ΪÁ˱ÜÃâ²Ù×÷·Ç·¨Ö¸Õ룬½«´úÂë°üº¬µÄtry¿éÖУ¬ÈôÓÐÒì³£±íʾָÕë·Ç·¨£¬µ«ÕâÑù³öÏÖµÄÎÊÌâÊÇ£ºÃ»ÓÐÒ쳣ʱ£¬²Ù×÷Ò²¿ÉÄܳö´í£¬²¢ÇÒÄÑÒÔ¼ì²éÕâÖÖ´íÎó¡£ÀýÈ磺aºÍbÊÇÁ½ÖÖ²»Í¬µÄ¶ÔÏó£¬Ä³¸öº¯ÊýÐèÒªaÀàÐͲÎÊý£¬²»ÐÒµÄÊÇ£¬Îó½«b´«¸øÁ˸ú¯Êý£¬ÒòbÒ²ÊÇÓÐЧµÄµØÖ·£¬ËùÒÔº¯Êý³É¹¦Ö´ÐÐÁË£¬Ã»ÓÐÒý·¢Òì³££¬µ«ÕâÖÖ²Ù×÷ÊÇÎÒÃDz»Ï£ÍûµÄ¡£Python¡¢LuaµÈ½Å±¾ÓïÑÔÊÇÈçºÎ½â¾ö´ËÀàÎÊÌâµÄ£¿
luaÎÒ²»ÖªµÀ.

pythonÖÐ, ÆäʵûÓÐÖ¸ÕëÕâ¸ö¸ÅÄîµÄ, ÒýÓÃÊÇÖ¸Ò»¸ö¾ä±úÖ¸ÏòÒ»¸ö¶Ñ¶ÔÏó...  µ«ÊÇ, ÕâЩ¶ÔÏóÕæÕýµÄÄÚ´æ²Ù×÷¶Ôpython³ÌÐòÔ±ÊÇ͸Ã÷µÄ, pythonºÍjavaÒ»Ñù, ͨ¹ýÀ¬»ø»ØÊÕ»úÖÆʹµÃÄÚ´æ¶Ô³ÌÐòԱ͸Ã÷»¯.  ËùÒÔ, ʹÓÃpython±à³Ìʱ, ´Ó³ÌÐòÔ±½Ç¶ÈÀíÂÛÉÏÀ´Ëµ, ²»»áÓÐËùνµÄÖ¸Õë·Ç·¨....

ʣϵÄ, ¾ÍÊÇÄãÃèÊöµÄÒì³£ÁË.ÄãËùÃèÊöµÄa, b²»Í¬µÄ¶ÔÏó, º¯ÊýÐèÒªa, ´«ÁËb, Õâ¸öÊôÓÚTypeError, µ«ÊÇ, pythonÊDz»»áÖªµÀÄãÕâÀïÊÇÒòΪ´«²Îµ¼ÖµÄ, ÒòΪpythonÊǶ¯Ì¬ÓïÑÔ, ÈõÀàÐÍ, ËùÒÔ, ÕâÖÖÇé¿öÍùÍùÐèÒª³ÌÐòÔ±×Ô¼º¼ÓÉÏÀàÐÍÑé֤ȥ¿ØÖÆ, ±ÈÈç
def f(a):
  if not isinstance(a, A):
    raise TypeError, 'Çë¸øÎÒÒ»¸öAÀàÐ͵IJÎÊý'
  #ʣϵÄ, È¥×öÄãÕý³£µÄÒµÎñ´¦Àí.

¶øÉÏÃæÄãÌáµ½µÄbÒ²ÊÇÓÐЧµÄµØÖ·, ËùÒÔº¯Êý³É¹¦Ö´ÐÐÁË, Äǵ±È»ÊÇÓпÉÄܵÄ, µ«ÄÇÊ


Ïà¹ØÎÊ´ð£º

[ÌáÎÊ]Python ÈçºÎºöÂÔ whitespace ¶ÁÈë

Ïñ C µÄ scanf() ÄÇÑù
±ÈÈç¶ÁÈë 1 2 3 a b c
ÿ´Î¶ÁÈëÒ»¸ö
ÏÂÃæÕâ¸öÓ¦¸ÃÊÇÄãÏëÒªµÄ°É£º
Python code:

>>> k = raw_input()
0 0123 ds dsl sd
>>> k
'0 0123 ds dsl sd'
>>> ......

IIS 7 python 2.6 cgi ÎļþÉÏ´«ÎÊÌâ

ÎÒÿ´ÎÉÏ´«µÄÎļþ¶Áµ½µÄÊý¾Ý¶¼²»ÕýÈ·¡£2M µÄͼƬ¶ÁµÃ10¶àK ¡£¡£ÄÄλ´óÏÀ¿ÉÒÔ°ï°ïÎÒ°¡¡£
#!D:\ProgrammerTools\python26\python.exe
#encoding=utf-8
import cgitb
import os
cgitb.enable()
import cgi,urllib ......

boost pythonÈçºÎ·â×°·µ»ØÖ¸ÕëµÄº¯Êý

double** Create_Double_Memory(int ySize, int xSize)
{
if (ySize <= 0 || xSize <= 0)
return NULL;

double** p = new double*[ySize];
for (int i = 0; i < ySize; i++)
......

boost python´«µÝÒýÓã¿

void xxx(int& x)
{
    x = 100;
}
def("xxx", xxx);

import y
a = 0
y.xxx(a)
±¨´íÁË£º
ArgumentError: Python argument types in
    L0_L ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ