1.python和c的混合编程没有弄懂
C language code (embedding)
#include <Python.h>
...
Py_Initialize(); // This is C, not Python
PyRun_SimpleString("x = 'brave ' + 'sir robin'"); // But it runs Python code
L = [1, 2] # Make a 2-item list
L.append(L) # Append L as a single item to itself
L # Print L
2.正则表达式需要学习
>>> import re
>>> match = re.match('Hello[ /t]*(.*)world', 'Hello Python world')
>>> match.group(1)
'Python '
>>> match = re.match('/(.*)/(.*)/(.*)', '/usr/home/lumberjack')
>>> match.groups()
('usr', 'home', 'lumberjack')
3.python和c的混合编程没有弄懂C language code (embedding)
#include
...
Py_Initialize(); // This is C,
not Python
PyRun_SimpleString("x = 'brave ' + 'sir robin'"); // But it
runs Python code
L = [1, 2] # Make a 2-item list
L.append(L) # Append L as a single item to itself
L # Print L