close

在python中 , 我們若要將輸入的內容一行行的讀取 , 

可以使用splitlines()這個method , 

for example :

infors=str(execSystemCmd('cat /etc/hosts')).splitlines()

for line in infors:

print line

 

 

ref : http://docs.python.org/library/stdtypes.html

arrow
arrow
    全站熱搜

    JerryCheng 發表在 痞客邦 留言(0) 人氣()