I find this line strange. I think you are checking if `command` is a path instead of a filename. It takes advantage that an empty string is `False`, where a non-empty string is `True`. I would rather use

    if '/' in command:

That way, it is obvious what you are checking.