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

boost python´«µÝÒýÓã¿

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

import y
a = 0
y.xxx(a)
±¨´íÁË£º
ArgumentError: Python argument types in
    L0_L1.xxx(int)
did not match C++ signature:
    xxx(int {lvalue})


ÇëÎÊÏñÕâÖÖ´«µÝÒýÓõĺ¯ÊýÈçºÎÓÃboost·â×°£¿


ÒýÓÃ
´«ÒýÓÃÊʺÏ×Ô¼ºÉè¼ÆµÄÀà»ò½á¹¹£¬»ù´¡ÀàÐÍÒªÉÔ΢°üװһϣ¬Æ©Èç¼òµ¥¶¨ÒåÁíÍâÒ»¸öº¯ÊýÀ´ºô½ÐÔ­º¯Êý£º
int _xxx(int _x){xxx(&_x)};È»ºódef("xxx",_xxx)...
ͬÒ⣬BoostÒ²²»ÊÇÍòÄܵģ¬»¹ÊÇÓкܶàËü²»ÄÜ°ü×°µÄ¶«Î÷¡£

ÒýÓÃ
´«ÒýÓÃÊʺÏ×Ô¼ºÉè¼ÆµÄÀà»ò½á¹¹£¬»ù´¡ÀàÐÍÒªÉÔ΢°üװһϣ¬Æ©Èç¼òµ¥¶¨ÒåÁíÍâÒ»¸öº¯ÊýÀ´ºô½ÐÔ­º¯Êý£º
int _xxx(int _x){xxx(&_x)};È»ºódef("xxx",_xxx)...

xxx(&_x)´«µÝµÄÊÇ_xµÄµØÖ·£¬Òª´«µÄÊÇÒ»¸öÒýÓã¬ÔÚC++Àï±àÒ뱨´í£¬ÎÞ·¨½«int* ת»¯Îªint&£¬¸ÃÔõôÉè¼Æ£¿

°¡...Ã÷ÏÔ²ÎÊý´íÁË£¬Ò²Â©·µ»ØÖµ¡£ÊÔÊÔ¸üÕýº¯ÊýÌåΪ{xxx(_x);return _x;}

ÒýÓÃ
ÒýÓà 1 Â¥ angel_su µÄ»Ø¸´:
´«ÒýÓÃÊʺÏ×Ô¼ºÉè¼ÆµÄÀà»ò½á¹¹£¬»ù´¡ÀàÐÍÒªÉÔ΢°üװһϣ¬Æ©Èç¼òµ¥¶¨ÒåÁíÍâÒ»¸öº¯ÊýÀ´ºô½ÐÔ­º¯Êý£º
int _xxx(int _x){xxx(&_x)};È»ºódef("xxx",_xxx)...

xxx(&_x)´«µÝµÄÊÇ_xµÄµØÖ·£¬Òª´«µÄÊÇÒ»¸öÒýÓã¬ÔÚC++Àï±àÒ뱨´í£¬ÎÞ·¨½«int* ת»¯Îªint&£¬¸ÃÔõôÉè¼Æ£¿



Ïà¹ØÎÊ´ð£º

pythonÖÐÏß³ÌÎÊÌ⣿£¿

ÎÒÏÖÔÚÊÇÕâÑùµÄ
¿ªÁËÒ»¸ö×ÓỊ̈߳¬¶ÁÈ¡ÏÂÃæµÄÏûÏ¢
±¾ÒâÊÇ
Python code:

while not self._stopevent.isSet( ):
re=¶ÁȡϲãÏûÏ¢
if re>0:
´¦Àí
else:
pass

¼ÙÈ ......

eric4ÔõôÔËÐÐpython³ÌÐò£¿

pythonºÍpyqtÒÔ¼°Eric4¶¼ÒѾ­ÅäÖúÃÁË£¬´ò¿ªEric4д¸öpython³ÌÐò±ÈÈç¼òµ¥µÄ
print¡°hello£¬world¡±£¬Ôõô±àÒëÔËÐÐÁË£¬Start²Ëµ¥µÄËùÓÐÃüÁ³öÏÖºÍͼÖв¶àµÄ¶Ô»°¿ò£¬Ó¦µ±ÔõôÔËÐÐÁË£¿

Çó´ó¼ÒÖ¸½Ì

ûÓÐÈËÓà ......

PythonÖеÄUnicodeÔÚDelphiÈçºÎ»¹Ô­³ÉGb2312£¿

ÒÑÖªPython ÖУº
s = unicode("²âÊÔ", "gb2312")
s = u'\u6d4b\u8bd5'
print s
²âÊÔ

ÔÚDelphiÀïÃæÈçºÎ½«\u6d4b\u8bd5ÕâÑùµÄ»¹Ô­³ÉGb2312µÄºº×ÖÄØ£¿
ÕÒµ½¸ö·½·¨
......

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 ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ