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

PythonÓïÑÔ¸ÅÀÀ

python
ÓïÑÔ¸ÅÀÀ
 
python
½Å±¾¿ÉÒÔ´¦ÀíÍⲿ´«½øÀ´µÄ²ÎÊý ¼´sys.argv[] 
£¬argv[]
µÄʹÓÃÓëlinux
ÏÂÏàͬ
python
±¾ÉíÊǽâÊÍÓïÑÔ£¬¿ÉÒÔ¶ÔÊäÈëµÄʽ×ÓÇóÖµ¡£python
Ö§³ÖµÄ¶ÔÏóÈçÕûÊý¶¼ÊÇÁ¢¼´Êý£¬´ËÍâËûÖ§³Ö¸´Êý£¬¼°¶ÔËÄÔòÔËËã½âÊÍ¡£
ptyhon
Ö§³Ö×Ö·û´®£¬·ÅÔÚµ¥/
Ë«ÒýºÅÄÚ£¬×Ö·û´®ÊÇÊý×飬¿ÉÒÔͨ¹ý[i:j]
²Ù×÷»ñµÃÖ¸¶¨Î»ÖÃ(i - j-1)
µÄÔªËØ¡£¶àÐеÄ×Ö·û´®¿ÉÒÔ·ÅÔÚ""" 
"""
ÖУ¬Èç¹ûÆäÖаüº¬ÁËתÒå×Ö·û£¬r"""\n"""
¿ÉÒÔÈÃËùÓÐ×Ö·û¶¼Êä³ö¡£
ÖØÔصÄ+ *
²Ù×÷£¬¿ÉÒÔÕ³ºÏ¶à¸ö×Ö·û´®¡£
python
Ö§³ÖµÄlist
ÓÃ[a,b,c]
À´±íʾ£¬¿ÉÒÔͨ¹ý[]
È¡¶ÔÓ¦µÄÔªËØ£¬Ö§³Ö¶à¸öÔªËظ³ÖµÈç a[2:4]=[1,2]
£¬list
ÖеÄÔªËØ¿ÉÒÔÊDz»Í¬ÀàÐ͵ġ£ÀàËÆÓÚlisp
£¬python
ÖеÄlist
¿ÉÒÔǶÌ×£¬Ç¶Ì×µÄlist
×÷Ϊһ¸öÔªËØ¡£
ΪÁ˱éÀúlist
¿ÉÒÔÓÃfor elem in list
£ºµÄ·½Ê½
 
Á÷³Ì¿ØÖÆ
python
ÖÐûÓÐ{}
£¬Ê¹ÓÃËõ½øÀ´±íʾ´úÂë¿é£¬¶ø£º±íʾһ¿é´úÂëµÄ¿ªÊ¼£¬È¡ÏûËõ½ø±íʾ´úÂë¿éµÄ½áÊø¡£
if
x >
0
:
       
print

1
elif
x==
0
:
       
print

0
else
:
       
print
-
1
 
Ìõ¼þ¿ØÖÆ
   
while a>0
   
in / not in
   
A and B or (not C)
 
 
ÀඨÒå
class
ÀàÃû£º
   
ÀàÌå
 
º¯Êý¶¨Òå
def fun(argv,argv=x)
£ºÖ§³ÖĬÈϲÎÊý
    
º¯ÊýÌå
Èç¹ûº¯Êý×îºóµÄÐβÎΪ**name
£¬Ôòº¯Êý½ÓÊմʵ䡣Èç¹ûº¯ÊýÐβÎΪ*name
£¬Ôòº¯Êý½ÓÊÕÒ»¸öÔª×é»òlist
¡£*name
±ØÐëÔÚ**name
֮ǰ¡£
def
fun
(*argv,**names):
   
for
arg
in
argv:
       
print
arg
   
print

'-'
*
40
   
keys = names.keys()
   
for
key
in
keys:
       
print
key,
":"
,names[key]
fun(
'here are some record'
,liming =
'123456'
,ligang=
'123455'
)
 
  
 
½â³ö²ÎÊý£¬


Ïà¹ØÎĵµ£º

Install Python + Eric IDE


Install Python Eric IDE
1 Download following things
 
1) Python3.1
 
2) PyQt for python 3.1
(http://www.riverbankcomputing.co.uk/software/pyqt/download) I am using
PyQt-Py3.1-gpl-4.7.3-2.exe
 
3) Eric5 IDE
(http://eric-ide.python-projects.org/eric-download.html)
 
2 ......

»ù±¾Êý¾Ý½á¹¹µÄpythonʵÏÖ ¶ÑÕ»

Ç°ÑÔ£º
×î½üÓÖÏëѧϰpython,ÓÖÏëÈ¥ÎÂÏ°Ò»ÏÂËã·¨£¬ÓÚÊǾÍÏë³öÁËÕâ¸öÁ½²»ÎóµÄ·½·¨,^_^
¶ÑÕ»£º
ʹÓÃpythonµÄÁбí½á¹¹£¬ÏêÇé¿ÉÒԲ鿴help(list)
#Filename: stack.py
shoplist=['apple','mango','carrot','banana']
shoplist.append('rice')
popitem=shoplist[-1]
del shoplist[-1]
print 'the popitem is',popitem
......

»ù±¾Êý¾Ý½á¹¹µÄpythonʵÏÖ ¶ÓÁÐ

¶ÓÁУº
Óë¶ÑÕ»ÀàËÆ£¬Í¨¹ýpythonµÄÁбíÀàÐÍÀ´ÊµÏÖ£¬²Î¿¼ help(list)
shoplist=['apple','mango','carrot','banana']
print 'I have',len(shoplist),'items to purchase'
print 'these items are:'
for item in shoplist:
print item,
shoplist.append('rice')
print 'my shopping list is now', shoplist
shoplist. ......

¡¶Dive Into Python¡··ÇËÀ²»¿É

ÒëÕßÑÔ£º
ÔçÔÚ 2008 Äê 8 Ô£¬ÎÒ¾ÍÔøÔÚ×Ô¼ºµÄ²©¿Í·¢±íÁËһƪ¡¶ÎªÊ²Ã´<Dive into Python>²»ÖµµÃÍƼö¡·£¨http://blog.csdn.net/lanphaday/archive/2008/08/28/2845258.aspx
£©£¬µ±Ê±ÒýÆðµÄÌÖÂ۾Ͳ»¶à˵ÁË£¬²»¹ýÊÂʵÉϵ½½ñÌìÈÔÈ»ÓÐÐí¶àÅóÓÑÁôÑÔÓëÎÒÌÖÂÛ£¬ÈÃÎÒ¼¸´ÎÔôÐIJ»ËÀ£¬ÏëдÔÙÉîÈëÅúÅС£ºÃÔ˵ÄʱºòÔÚÎÒÕæÕýÔÜ×㶯Á ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ