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

PythonÖÐÖ´ÐÐshellÃüÁîµÄʵÀý

1¡£
myCoolVariable="some_string"
os.system("echo myCoolVariable")
2.
>>> os.system('echo "asdg"')
asdg
0
>>> os.system("echo 'asdgwere'")
asdgwere
0
3.
$ python
>>>hamburger="potato"
>>>import os
>>>os.system("echo 'hamburger'")
potato
0
4.
hamburger=os.system('echo $MY_SHELL_VAR | sed "s/longsed/replacement/g"')
5.
>>> string="python is cool"
>>> cmd="echo "+string
>>> os.system(cmd)
python is cool
0
>>>
6.
bash$ python
Python 2.4.3 (#1, May 18 2006, 07:40:45)
[GCC 3.3.3 (cygwin special)] on cygwin
Type "help", "copyright", "credits" or "license" for more information.
>>> from os import system
>>> food = 'spam'
>>> system('echo %(food)s' % locals())
spam
0
>>>


Ïà¹ØÎĵµ£º

cÓïÑÔÄ£Äâperl pythonÖеÄÊý×鸺ÊýË÷Òý

int main()
{
int a[] = {1,2,3,4,5};
int i;
int * p = a;
for (p = a + 4, i = 0; i < 5; i++) {
printf("%d ",p[-i]);
}

return 0;
}

......

Twisted ÍøÂ翪·¢python¿ò¼Ü

twistedÊÇÒ»¸öרÃÅÓÃÓÚpythonµÄÍøÂ翪·¢µÄ¿ò¼Ü¡£¿ÉÒÔ˵ÊÇÏÖÔÚpythonÖÐеÄÒ»Ö§ÖÁÁ¦ÓÚ·¢Õ¹¸ßÐÔÄÜÍøÂ翪·¢µÄ¿ò¼Ü£¬·¢Õ¹ºÜÎȶ¨¡£
http://twistedmatrix.com/trac/
http://www-128.ibm.com/developerworks/cn/linux/network/l-twist/part1/index.html
http://wiki.woodpecker.org.cn/moin/PyTwisted ......

PythonÈëÃÅ

Ò»¡¢Ê²Ã´ÊÇPython£¿
¶ÔÓÚÕâÖÖÎÊÌâÎÒÃÇÀ´°Ù¶ÈһϾͿÉÒÔÁË¡£
“PythonÊÇÒ»ÖÖ¿ª·ÅÔ´´úÂëµÄ½Å±¾±à³ÌÓïÑÔ£¬ÕâÖֽű¾ÓïÑÔÌرðÇ¿µ÷¿ª·¢ËٶȺʹúÂëµÄÇåÎú³Ì¶È¡£Ëü¿ÉÒÔÓÃÀ´¿ª·¢¸÷ÖÖ³ÌÐò£¬´Ó¼òµ¥µÄ½Å±¾ÈÎÎñµ½¸´Ôӵġ¢ÃæÏò¶ÔÏóµÄÓ¦ÓóÌÐò¶¼ÓдóÏÔÉíÊֵĵط½¡£Python»¹±»µ±×÷Ò»ÖÖÈëÃųÌÐòÔ±×îÊʺÏÕÆÎÕµÄÓÅÐãÓïÑÔ£¬ÒòΪËüÃâ·Ñ¡¢Ã ......

pythonÖÐÀàµÄÊôÐÔ

pythonÖÐÀàµÄÊôÐÔ
pythonÖеÄÀà½Ðclass object,ÀàµÄʵÀý½Ðinstance object.
Àà Class Objects
ÀàÓµÓÐÁ½ÖÖ²Ù×÷,1.ÀàÊôÐÔ attribute references 2.ʵÀý»¯instantiation
1.ÀàÊôÐÔ¾ÍÏ൱ÓÚרÊôÓÚÒ»¸öÀàµÄ±äÁ¿(¼´Ä³Ð©ÓïÑÔÖеÄÀàµÄ¾²Ì¬¹«¹²±äÁ¿static public),ʹÓ÷½·¨ÊÇ:ÀàÃû³Æ.ÀàÊôÐÔÃû³Æ
2.ʵÀý»¯ÔòÊÇ´´½¨Ò»¸öÀàµÄʵÀýµÄ· ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ