python - 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.
Thanks in advance for the help.
解决方案
您必须提及文件“sshdlog”的完整路径,with open("full path to sshdlog file") as f
或者您的脚本和 sshdlog 位于同一目录中。
推荐阅读
- ios - Stripe Basic PaymentIntent 确认付款错误
- android - Android 定期工作管理器在 android 8.1 中不起作用
- java - 从 Java 中的 InputStream 读取 ESRI shapefile
- file - 如何解决错误“不允许数据库邮件发送带有文件扩展名的文件”?
- flutter - 如何使用 Flutter 在本地解析 json
- java - 如果我的实体包含对象 Libro,如何创建计算 id_libro 的查询
- react-native - 哪个是最好的反应原生 FlatList 或 Flipkart recyclerlistview?
- java - 使用 IntelliJ 调试 GWT
- java - 从 Optional.ifPresent() Java 8 抛出异常
- java - Java Firebase 服务器应用程序.. 当我在 IntelliJ 中运行它时工作正常,但 .class 文件没有运行