python編程 python中unexpectedEOFwhileparsing什么意思?
python中unexpectedEOFwhileparsing什么意思?這是典型的,沒有驗證函數(shù)參數(shù)是否有效。您可以運行以下代碼來查看輸出。Try:print Eval(”)exception as
python中unexpectedEOFwhileparsing什么意思?
這是典型的,沒有驗證函數(shù)參數(shù)是否有效。
您可以運行以下代碼來查看輸出。
Try:print Eval(”)exception as ex:print(ex)
輸出如下
解析時出現(xiàn)意外的EOF(<string>,第0行)>>>
原因是Eval(STR)的字符串為空。按如下所示修改代碼,并使用自定義提示而不是系統(tǒng)提示
!Try:print Eval(STR)exception as ex:print(“expression is empty,please check”)除外