Frank Chang wrote:
When I use the Python 2.7.1 interpreter I get the following traceback
:
F:\shedskin\shedskin-0.7>python automata_test2.py
Traceback (most recent call last):
File "automata_test2.py", line 23, in <module>
list(automata.find_all_matches('nice', 1, m))
AttributeError: 'module' object has no attribute 'find_all_matches'
Could anyone help me fix this error? I am new to python. Thank you.
This error tells you that the module "automata.py" does not have a
global-level object called "find_all_matches".
If you look at the module, you will see it does not have a global-level
object called "find_all_matches", exactly as Python tells you. To fix
this, you need to either:
(1) Give the automata module a function "find_all_matches" that does
what you expect it to do; or
(2) Change automata_test2 to create a DFA instance, then call the
find_all_matches method in that instance. Something like:
instance = automata.DFA(start_state)
instance.find_all_matches("word", k, lookup_func)
--
Steven
_______________________________________________
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor