python的一個(gè)異常EOf?
比如說我寫了如下代碼,循環(huán)獲取用戶輸入:12345678910lst = []s = 's'while(True):try:s = input('please input:')lst.append(s)except Exception as ex:print(ex)breakprint(lst)當(dāng)用戶按ctrl+d的時(shí)候就表示停止輸入,python就會(huì)顯示EOF異常
python的一個(gè)異常EOf?
比如說我寫了如下代碼,循環(huán)獲取用戶輸入:12345678910lst = []s = 's'while(True):try:s = input('please input:')lst.append(s)except Exception as ex:print(ex)breakprint(lst)當(dāng)用戶按ctrl+d的時(shí)候就表示停止輸入,python就會(huì)顯示EOF異常