python的dict嵌套訪問

iptest.txt

gssi_jyg	嘉峪關	10.192.194.92	jygzx_domain	/home/bea/zx_apps	/home/bea/zx_apps/eapdomain	/home/bea/zx_apps/startstop	/home/bea/zx_apps/logs	/home/weblogic/user_projects/domains/jygzx_domain
gssi_jyg	嘉峪關	10.192.194.93	jygzx_domain	/home/bea/zx_apps	/home/bea/zx_apps/eapdomain	/home/bea/zx_apps/startstop	/home/bea/zx_apps/logs	/home/weblogic/user_projects/domains/jygzx_domain
gssi_jcs	金昌	10.192.194.104	jczx_domain	/home/bea/zx_apps	/home/bea/zx_apps/eapdomain	/home/bea/zx_apps/startstop	/home/bea/zx_apps/logs	/home/weblogic/user_projects/domains/jczx_domain
gssi_jcs	金昌	10.192.194.105	jczx_domain	/home/bea/zx_apps	/home/bea/zx_apps/eapdomain	/home/bea/zx_apps/startstop	/home/bea/zx_apps/logs	/home/weblogic/user_projects/domains/jczx_domain

iplist.py

sshcmdfile=open("iptest.txt",encoding='utf-8')
sshallcity={}
for linerow in sshcmdfile:
	sshcmdarg=linerow.split('\t')
	if len(sshcmdarg)!=9:
		continue
	sshhostcode = sshcmdarg[0]
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章