首页 > 解决方案 > How to solve the NameError error in a python script ( on linux CentOS)

问题描述

I am trying to make a Python script on Cent OS 8 but I constantly get this 'NameError' message and I just can't figure out what could be the problem. Here you'll see screenshots of both my script and the error message.

The error message

My script

Thanks in advance for the help.

标签: pythonlinuxscriptingcentosnameerror

解决方案


您必须提及文件“sshdlog”的完整路径,with open("full path to sshdlog file") as f或者您的脚本和 sshdlog 位于同一目录中。


推荐阅读