PythonÖ®HelloWorld!
½ñÌìÔÚȺÀï¿´µ½ÓÐÈËÔÚÌÖÂÛPython£¬ÓÚÊÇGGÏÂÏ£¬Ã²ËÆÂùÇ¿´óµÄÑù×Ó¡£ÓÚÊÇϰàºóÔÚ×Ô¼º±¾¶ùÉÏÏÂÔØ£¬ÓôÃÆµÄÊǹÙÍø¾ÓÈ»ÎÞ·¨´ò¿ª¡£µ±È»ÁË£¬Õâ¸öÎÊÌâ²»´ó£¬ÓÚÊǺõÓÃÔÚÏß´úÀíµÇ¼ÏÂÔØ——!¿ÉÊÇ£¬´úÀíÏÂÔØ²»Äܳ¬¹ý2M£¬¿ÉÄÜÊÇÎÒÑ¡µÄ´úÀíÍøÕ¾ÎÊÌâ°É¡£ºóÀ´¾ÍÖ±½ÓÈ¥ËÑPythonÏÂÔØ£¬È»ºóÔÚÐÂÀËϵ½×îаæµÄ3.1 .1 RC¡£
È»ºó¾ÍÊÇNextµÄ°²×°£¬Íê±ÏÔÙ¼ÓÈ뵽ϵͳ±äÁ¿¡£
¿´µ½Óн̳Ìдµ½¾µäµÄHelloWorld³ÌÐò
print 'Hello World!'
ÇýøÈ¥Ö®ºó½á¹ûÌáʾ“SyntaxError: invalid synta”£¬¾À½á¡£ÍøÉϲéÁËÏ£¬ÔÀ´3.1°æ±¾µÄÐèÒª¸Ä³É
print('Hello World!')
ßÀ£¬ÕâÑù£¬HelloWorldÍê³É¡£
Ïà¹ØÎĵµ£º
´úÂëÖвÉÓÃÁËÈý²½ÊµÏÖËãÊõ±í´ïʽµÄ½âÎö:
1. ½«ËãÊõ±í´ïʽ(×Ö·û´®)ת»»³ÉÒ»¸öÁбíparseElement·½·¨
2. ½«Áбí±íʾµÄËãÊõ±í´ïʽת»»³Éºó׺±í´ïʽchangeToSuffix
3. ¼ÆËãºó׺±í´ïʽµÄ½á¹û
ÕâÀïÎÒÊÇΪÁË·½±ã, ¾ÍдÁ˸öparseElement, ²»ÏëÄÇ·½·¨Ð´µ½ºóÃæÈ´°Ñ×Ô¼ºÈÆ×¡ÁË, ¿ÉÒÔÏëÏóÒ»¸ö´ø×ÔÔö, λ, Âß¼, ËãÊõµÄ±í´ïʽµÄÊýÖµÌá ......
żȻÐèÒªÓõ½ÕâÑùÒ»¸öº¯Êý£¬ÔÚDelphiÖУ¬ÓÐÏֳɵĺ¯Êý¿ÉÒÔµ÷Óã¡ÔÚpythonÖУ¬ÎÒÕÒÁ˰ëÌì¶¼»¹Ã»ÕÒµ½£¬×îºó×Ô¼ºÐ´ÁËÒ»¸öº¯ÊýÈçÏ£º
def dayOfMonth(date):
if date.month == 12:
return 31
else:
return (date.replace(month=date.month+1, day=1) - datetime.timedelta(days=1)).day
......
ѧϰpython±¾¾ÍÊÇÒµÓàÖ®ºÃ£¡Ê鱾ɶµÄ£¬¶¼ÎÞ´Ó˵Æð¡£ËùÒÔż¶ûÅöµ½Ò»¸öºÃµÄÄ£¿é£¬¾ÍÒªÔÚ²©¿ÍÖмǼһÏ£¬ÒÔ±ãÈÕºóÖ®Óá£ÊÇÒÔ¸ßÊÖÖ±½ÓµÄÆ®¹ý¡£ÏÂÃæÇÐÈëÕýÌâ¡£
globÊÇpython×Ô¼º´øµÄÒ»¸öÎļþ²Ù×÷Ïà¹ØÄ£¿é£¬ÄÚÈÝÒ²²»¶à£¬ÓÃËü¿ÉÒÔ²éÕÒ·ûºÏ×Ô¼ºÄ¿µÄµÄÎļþ£¬¾ÍÀàËÆÓÚWindowsϵÄÎļþËÑË÷£¬¶øÇÒÒ²Ö§³ÖͨÅä·û£¬*,?,[]Õ ......
client:
import socket, sys
if __name__ == '__main__':
#´¦Àí²ÎÊý
argv = sys.argv
if (len(argv)!=3) or (len(argv)==2 and argv[1]=='/?'):
print '>>>Useage:', argv[0], '<address> < ......