Essentially I have run into a problem regarding a Type Error on line 3, I am presented with "TypeError: 'str' object is not callable" Any advice would be appreciated /Ubuntu/python3/terminal
import os
#Imports operating system modules
user_file_search = input()('Type Millienium2000')
#Prompt the user to enter password
encoded = user_file_search.encode('hex')
#Decodes files based on hex
for root, dirs, files in os.walk ('/Desktop/POP/PoP_Coursework_Assignment/Svr1/documents$'):
for data in files :
pass_file = open(os.path.join(root,data)).read()
if(encoded in pass_file):
print ('This could be the pass : {}'.format(os.path.join(root,data)))
print ('Located data: {}'.format(pass_file))
#Prints Data retrived
I am presented with the following
Traceback (most recent call last):
File "oswalk.py", line 3, in
user_file_search = input()('Type Millienium2000')
TypeError: 'str' object is not callable
Thanks in advance!
UPDATE! Code is working fantastically now! Thanks all! I have encountered a new issue being told that
File "oswalk.py", line 5, in
encoded = user_file_search.encode('hex') LookupError: 'hex' is not a text encoding; use codecs.encode() to handle arbitrary codecs
All the files Im searching through are encoded with HEX, is it because there's an alternative input for hex?
input('Type Millienium2000')
. Closing as typo.input('Type Millienium2000')
. You can't add extra parentheses and call it that way