@line_magic<EOL><INDENT>def connect_info(self, arg_s):<DEDENT>
from IPython.core.application import BaseIPythonApplication as BaseIPApp<EOL>if BaseIPApp.initialized():<EOL><INDENT>app = BaseIPApp.instance()<EOL>security_dir = app.profile_dir.security_dir<EOL>profile = app.profile<EOL><DEDENT>else:<EOL><INDENT>profile = '<STR_LIT:default>'<EOL>security_dir = '<STR_LIT>'<EOL><DEDENT>try:<EOL><INDENT>connection_file = get_connection_file()<EOL>info = get_connection_info(unpack=False)<EOL><DEDENT>except Exception as e:<EOL><INDENT>error("<STR_LIT>" % e)<EOL>return<EOL><DEDENT>profile_flag = "<STR_LIT>" % profile if profile != '<STR_LIT:default>' else "<STR_LIT>"<EOL>if security_dir == os.path.dirname(connection_file):<EOL><INDENT>connection_file = os.path.basename(connection_file)<EOL><DEDENT>print (info + '<STR_LIT:\n>')<EOL>print ("<STR_LIT>"<EOL>"<STR_LIT>"<EOL>"<STR_LIT>"<EOL>"<STR_LIT>"<EOL>"<STR_LIT>"<EOL>"<STR_LIT>"<EOL>"<STR_LIT>".format(<EOL>connection_file, profile_flag<EOL>)<EOL>)<EOL>
Print information for connecting other clients to this kernel

        It will print the contents of this session's connection file, as well as
        shortcuts for local clients.

        In the simplest case, when called from the most recently launched kernel,
        secondary clients can be connected, simply with:

        $> ipython <app> --existing