[ÌáÎÊ]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'
>>> k.split(' ')
['0', '0123', 'ds', 'dsl', 'sd']
>>>
LSµÄ»Ø´ð²»´í
²»ÖªµÀpythonÓÐûÓÐÏֳɵĺ¯Êý¿ÉÒÔµ÷ÓÃ
×ÜËã·¢ÏÖÁ˽â¾ö·½·¨
ʹÓà ctypes ¿â
from ctypes import *
libc = CDLL('libc.so.6')
a = c_int()
b = c_double()
c = c_char()
s = create_string_buffer(100)
libc.scanf('%c%d%lf%s', byref(c), byref(a), byref(b), byref(s))
print c.value, a.value, b.value, s.value
43842050 Python,c/c++Ⱥ£¬ÓÐÖ¾ÏëѧPython,CºÍC++µÄÅóÓÑÇë¼ÓÈëȺ¡£
Ïà¹ØÎÊ´ð£º
//ÏÂÃæµÄ´úÂëÔËÐÐÕý³£
tomstrs=re.findall(......)
mtxx=''
for tomstr in tomstrs:
tomstr=tomstr.strip()
if tomstr:
mtxx += tomstr ......
±ÈÈç
Python code:
@orm.validates('title')
def validate_title(self, key, title):
"""Assure that page titles are wikiwords and valid length"""
......
http://www.cioage.com/art/200906/78173.htm
¾ÝϤ£¬¿¨°Í˹»ùʵÑéÊÒÉÏÖܼì²âµ½Ò»ÖÖ¹¥»÷Èû°àϵͳµÄжñÒâ³ÌÐò£¬¸Ã³ÌÐòµÄ¹¥»÷Ä¿±êÊÇÒ»¼ÒÓ¡¶ÈÄáÎ÷ÑÇÒÆ¶¯µç»°ÔËÓªÉ̵ÄÓû§¡£¸ÃľÂíÓÉÒ»ÖֽРPythonµÄ½Å±¾ÓïÑÔ±àд£¬Ëü» ......
ÒÑÖªPython ÖУº
s = unicode("²âÊÔ", "gb2312")
s = u'\u6d4b\u8bd5'
print s
²âÊÔ
ÔÚDelphiÀïÃæÈçºÎ½«\u6d4b\u8bd5ÕâÑùµÄ»¹Ô³ÉGb2312µÄºº×ÖÄØ£¿
ÕÒµ½¸ö·½·¨
......