-3
解析我試圖打印具有單詞一個程序,我得到它具有分裂和印刷下一字行:我的計劃是沒有得到輸出Python從動態輸入線
with open("qwer.txt",'r') as v1:
for line in v1:
if 'good' in v1:
print(v1)
if '=' in v1:
print v1.split('=')[1]
if '==' in v1:
print v1.split('==')[1]
qwer.txt:
Ram is very good=ideal student
Ram has nice character==Perfect student
輸出:
Ram is very good=ideal student
ideal
它一旦語句p不執行rovided,請幫我得到輸出!
你的問題到底是什麼?該代碼完全按照您的要求進行操作 - 選擇具有最高「fuzz.ratio」(不管那是什麼)的行並打印在「=」後面的行。請提供一個[minimal example](http://stackoverflow.com/help/mcve),其他人可以使用它來複制行爲(即包括'fuzz.ratio'),並清楚地解釋你所得到的與你的不同之處預期。 – jonrsharpe
我編輯了這個問題,你能幫我讓輸出運行嗎? – adarshram
你的新「代碼」不會運行(''NameError''如果'好'在線),你仍然沒有解釋問題是什麼**。 – jonrsharpe