direct entry

I have the following code

def setText(textEntered):
	if b = "delete toontown.exe":
		if (os.path.exists('toontown.exe')):
			os.unlink('toontown.exe')
 
#clear the text
def clearText():
	b.enterText('')
 
#add button
b = DirectEntry(text = "" ,scale=.05,command=setText,
initialText="Type Something", numLines = 2,focus=1,focusInCommand=clearText)

And I get

if b = "delete toontown.exe":
Invalid syntax
if textEntered == "delete toontown.exe":

Thanks will try tomorrow.

Yes, like Wezu said it should be ==. = is defining something, == is checking if they’re the same, and != is checking if they’re different.

Thanks. Do anyone have an idea of how to make toontown.exe be any file so if I typed delete ramd.om it will delete anything I type

Like:

if textEntered:
    if (os.path.exists(textEntered)):
        os.unlink(textEntered)

?

Somehow I feel this is gonna end up as some malicious code. Good luck anyway (and you might wanna look up some python tutorials).

No. Im just making a program where I type in simple words what I want it to do and it will do it