Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- nodelist = ["1.1.1.1", "2.2.2.2"]
- def checkactivenode(file_name, ip_to_search):
- with open(file_name, 'r') as read_obj:
- for list in read_obj:
- if ip_to_search in list:
- return True
- return False
- after executing: checkactivenode(filename, nodelist)
- Error:
- Traceback (most recent call last):
- File "main.py", line 42, in <module>
- checkactivenode(pwlcfullpath, nodelist)
- File "main.py", line 33, in checkactivenode
- if ip_to_search in list:
- TypeError: 'in <string>' requires string as left operand, not list
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement