This is my code:
elif command == "3.1":
os.system("cls")
conn.send(command.encode())
boxtitle = input("Please enter the title of the message : ")
print("[16] - Critical")
print("[32] - Question")
print("[48] - Warning")
print("[64] - Info")
boxerro = input("Please enter Error Type: ")
box = input("Please enter the message you would like to write : ")
reading_file = open("errors.vbs", "r")
new_file_content = ""
for line in reading_file:
stripped_line = line.strip()
new_line = stripped_line.replace("x=msgbox(, 0+, )", "x=msgbox"(box, "0+", boxerro, boxtitle))
new_file_content += new_line +"\n"
reading_file.close()
writing_file = open("errors.vbs", "w")
writing_file.write(new_file_content)
writing_file.close()
What I'm trying to do here is when the command 3.1 is called it clears the cmd window sends this over to my client file and then it runs through what would you like I only get to the error on new_line = stripped_line.replace("x=msgbox(, 0+, )", "x=msgbox"(box, "0+", boxerro, boxtitle))
What I'm doing here is its opening errors.vbs replacing what I have with what I want and closing it but I get the error
new_line = stripped_line.replace("x=msgbox(, 0+, )", "x=msgbox"(box, "0+", boxerro, boxtitle))
SyntaxWarning: 'str' object is not callable; perhaps you missed a comma?
But When I checked I couldn't see if I missed an error I'm really not sure how to fix these.