Note
This documentation is for a development version of IPython. There may be significant differences from the latest stable release (1.2.1).
Utilities for connecting to kernels
Authors:
Bases: IPython.config.configurable.Configurable
Mixin for configurable classes that work with connection files
Cleanup connection file if we wrote it
Will not raise if the connection file was already removed somehow.
Cleanup ipc files if we wrote them.
return zmq Socket connected to the Heartbeat channel
return zmq Socket connected to the Heartbeat channel
return zmq Socket connected to the IOPub channel
return zmq Socket connected to the Shell channel
return zmq Socket connected to the StdIn channel
return the connection info as a dict
Load connection info from JSON dict in self.connection_file.
Write connection info to JSON dict in self.connection_file.
Generates a JSON config file, including the selection of random ports.
Parameters: | fname : unicode
shell_port : int, optional
iopub_port : int, optional
stdin_port : int, optional
control_port : int, optional
hb_port : int, optional
ip : str, optional
key : str, optional
signature_scheme : str, optional
|
---|
Return the path to the connection file of an app
Parameters: | app : IPKernelApp instance [optional]
|
---|
find a connection file, and return its absolute path.
The current working directory and the profile’s security directory will be searched for the file if it is not given by absolute path.
If profile is unspecified, then the current running application’s profile will be used, or ‘default’, if not run from IPython.
If the argument does not match an existing file, it will be interpreted as a fileglob, and the matching file in the profile’s security dir with the latest access time will be used.
Parameters: | filename : str
profile : str [optional]
|
---|---|
Returns: | str : The absolute path of the connection file. |
Return the connection information for the current Kernel.
Parameters: | connection_file : str [optional]
unpack : bool [default: False]
profile : str [optional]
|
---|---|
Returns: | The connection dictionary of the current kernel, as string or dict, depending on unpack. |
Connect a qtconsole to the current kernel.
This is useful for connecting a second qtconsole to a kernel, or to a local notebook.
Parameters: | connection_file : str [optional]
argv : list [optional]
profile : str [optional]
|
---|---|
Returns: | subprocess.Popen instance running the qtconsole frontend |
tunnel connections to a kernel via ssh
This will open four SSH tunnels from localhost on this machine to the ports associated with the kernel. They can be either direct localhost-localhost tunnels, or if an intermediate server is necessary, the kernel must be listening on a public IP.
Parameters: | connection_info : dict or str (path)
sshserver : str
sshkey : str [optional]
|
---|---|
Returns: | (shell, iopub, stdin, hb) : ints
|