ÈçÌ⣬
¡¶pythonÔ´ÂëÆÊÎö¡·ÖеÚ32Ò³£¬
Óиö¼ì²é¼Ó·¨½á¹ûÊÇ·ñÒç³öµÄ´úÂ룬
´óÖÂÈçÏ£º
C/C++ code:
long a, b, x;
x = a + b;
//¼ì²é½á¹ûÊÇ·ñÒç³ö
if((x^a)>=0 || (x^b)>=0)
return OK; //ûÓÐÒæ´¦£¿
Çë½Ì£¬
ΪʲôÉÏÃæµÄÁ½¸öÒì»ò¿ÉÒÔÅжÏÊÇ·ñÒç³ö£¿
лл£¡£¡
ÎÒ¶¥
¼Ù¶¨longÊÇ ......
ÒÑÖªPython ÖУº
s = unicode("²âÊÔ", "gb2312")
s = u'\u6d4b\u8bd5'
print s
²âÊÔ
ÔÚDelphiÀïÃæÈçºÎ½«\u6d4b\u8bd5ÕâÑùµÄ»¹Ô³ÉGb2312µÄºº×ÖÄØ£¿
ÕÒµ½¸ö·½·¨
function UniCode2GB(S : String):String;
Var
I: Integer;
begin
I := Length(S); ......
ÇëÎÊÏ£¬ÎÒµÄÊÇpython2.5°²×°ÁËPILÄ£¿é£¬È»ºó±àд³ÌÐò´ò¿ª±¾»úÉϵÄÒ»¸öͼƬʱ£¬ÎªÊ²Ã´ÀϳöÏÖ´íÎóÄØ£¬ÀÏÊÇÕÒ²»µ½Í¼Æ¬£¬´íÎóÌáʾÈçÏ£ºFile "C:\Python25\Lib\site-packages\PIL\Image.py", line 1888, in open
fp = __builtin__.open(fp, "rb")
IOError: [Errno 2] No such f ......
Ïñ C µÄ scanf() ÄÇÑù
±ÈÈç¶ÁÈë 1 2 3 a b c
ÿ´Î¶ÁÈëÒ»¸ö
ÏÂÃæÕâ¸öÓ¦¸ÃÊÇÄãÏëÒªµÄ°É£º
Python code:
>>> k = raw_input()
0 0123 ds dsl sd
>>> k
'0 0123 ds dsl sd'
>>> k.split(' ')
['0', '0123', 'ds', 'dsl', 'sd']
>>>
LSµÄ»Ø´ð²»´í
²»ÖªµÀpythonÓÐûÓÐÏÖ³ ......
ËÍƼöÒ»±¾Ñ§Ï°PYTHONµÄÊ飬лл
¡¶python¼òÃ÷½Ì³Ì¡·£¬¡¶pythonºËÐıà³Ì¡·
×÷Ϊϵͳ¹ÜÀí·½Ã棬¡¶Python UNIXºÍLinuxϵͳ¹ÜÀíÖ¸ÄÏ¡·ÊDZ¾·Ç³£²»´íµÄÊé¡£
http://club.book.csdn.net/pic3/255142.jpg
ÒýÓÃ
×÷Ϊϵͳ¹ÜÀí·½Ã棬¡¶Python UNIXºÍLinuxϵͳ¹ÜÀíÖ¸ÄÏ¡·ÊDZ¾·Ç³£²»´íµÄÊé¡£
http://club.book.csdn.net/pic3 ......
#include <Python.h>
#include <string>
#include <vector>
#include <iostream>
using namespace std;
int main(int argc, char* argv[])
{
vector <string> results;
PyObject *module,*liststr,*dic,*fun,*argss;
Py_ssize_t slen;
Py_Initialize(); ......