Не знаете, почему этот код не работает.Def не работает
class convert_html(sublime_plugin.TextCommand):
def convert_syntax(self, html, preprocessor)
return "this is just a " + preprocessor + " test"
def convert_to_jade(self, html):
return self.convert_syntax(html, "jade")
def run(self, edit):
with open(self.view.file_name(), "r") as f:
html = f.read()
html = html.convert_to_jade(html)
print(html)
Это говорит AttributeError: 'str' object has no attribute 'convert_html'
Как заставить его работать?
добавить код, где вы используете этот класс – average
Вы пропускаете двоеточие в конце 'четкости convert_syntax (я, html, препроцессор) ' – Floris