for session in output..splitlines():
                                    ^
SyntaxError: invalid syntax