'STU' object has no attribute 'run'
时间: 2023-10-15 14:04:53 浏览: 89
This error message suggests that you are trying to call the "run" method on an object of the "STU" class, but that class does not define a "run" method.
It's hard to provide more specific advice without seeing the code that is causing the error, but here are a few possible explanations and solutions:
- Check the spelling and capitalization of the method name. If you intended to call a method called "run", make sure you spelled it correctly and used the correct capitalization (Python is case-sensitive).
- Make sure the "STU" class actually defines a "run" method. If not, you may need to create one or use a different method that is defined for that class.
- Check that you are calling the method on an instance of the "STU" class, rather than on the class itself. For example, if you have a variable called "stu" that refers to an instance of the "STU" class, you would call the "run" method like this: "stu.run()". If you try to call "STU.run()" instead, you will get an error because the class itself does not have a "run" method.
阅读全文