Use if else syntax to input the value

image

I use if condition to input the value, but the result shows the error.

image

Thanks for help.

Python is a structured language so whitespace matters. Notice the tabs.

filename = ...
if filename is None:
    #do something
else:
    #do something else
3 Likes

Hi, sorry I didn't get it. Should I delete the whitespace?

		if filename is not None:
		fileid=self.getSibling("fileidnone").props.text
		else:
		fileid=elf.getSibling("fileid").props.text

You'll need to do an intro to python course to ease your scripting learning curve.

def runAction(self, event):
	...
	if filename is not None:
		fileid=self.getSibling("fileidnone").props.text
	else:
		fileid=elf.getSibling("fileid").props.text
1 Like

https://docs.python.org/2.7/tutorial/introduction.html#first-steps-towards-programming

Thanks for your help. I'm learning and keeping moving.

1 Like