0

I am trying to make a MS-DOS like program like python. I am adding a system to see if a command exists. the file "known.txt" contains:

['catfish', 'cls', 'dl', 'hello', 'help', 'help1', 'help2', 'info', 'logout', 'ping', 'run', 'stop', 'time']

This is the code i am using to run it:

if pnt in open('known.txt').read():
        sys.path.insert('F:/Term/commands/')
        answermodule = importlib.import_module(cmd)

but when i run it, i get this:
TypeError: 'in <string>' requires string as left operand, not tuple

how could i fix this?

2
Contributors
2
Replies
38
Views
1 Year
Discussion Span
Last Post by Dat One Lefty
0

Some code is missing, I get

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
 NameError: name 'pnt' is not defined

please post the code that generates your error message, plus full traceback.

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.