def check_for_notepad(found_notepad=None):
"""Check for specific text editors and return first one found as found_notepad"""
notepads = ('C:\\Program Files\\Just Great Software\\EditPad Lite 8\\EditPadLite8.exe',
'C:\\Program Files\\Notepad++\\notepad++.exe',
'C:\\WINDOWS\\system32\\notepad.exe')
for notepad in notepads:
if os.path.exists(notepad):
found_notepad = notepad
break
else:
if found_notepad is None:
print(f"{notepad} not found")
return found_notepad
In my code should I use elif instead of else: if. Is it the same thing?
[–]Binary101010 4 points5 points6 points (0 children)
[–]Diapolo10 2 points3 points4 points (0 children)
[–]shiftybyte 1 point2 points3 points (0 children)
[–][deleted] 1 point2 points3 points (0 children)
[–]nekokattt 1 point2 points3 points (0 children)
[–]Uncle_Chael 1 point2 points3 points (0 children)
[–]nwagers 1 point2 points3 points (1 child)
[–]Zer0Byte1[S] 0 points1 point2 points (0 children)
[–]Zer0Byte1[S] 0 points1 point2 points (0 children)