Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
""" | |
zmq_cli - 0MQ Server interruptability test case, client module. | |
""" | |
import zmq | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# override ioloop.IOLoop with zmq's IOLoop | |
import sys | |
import tornado.ioloop | |
from zmq.eventloop import ioloop | |
tornado.ioloop.IOLoop = ioloop.IOLoop | |
import trombi | |
loop = ioloop.IOLoop.instance() | |
# check that tornado's ioloop instance is actually zmq's |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import thread | |
import time | |
import zmq | |
# global zmg context | |
context = zmq.Context() | |
endpoint = "tcp://*:8888" | |
# the subscriber thread function | |
def subscriber(name, address, cnt, subscriptions): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
A test forking server | |
To start a single kernel by forking, do:: | |
python -i testfork.py | |
The kernel object will be in the ``a`` variable. When you close the | |
python session, the forked kernel will be killed. | |
""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from IPython.frontend.qt.console.qtconsoleapp import IPythonQtConsoleApp | |
a = IPythonQtConsoleApp() | |
a.initialize() | |
# load the sympyprinting extension in the kernel before starting | |
a.kernel_manager.shell_channel.execute("%load_ext sympyprinting", silent=True) | |
a.start() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import json, time, threading | |
import zmq | |
from zmq.eventloop import ioloop, zmqstream | |
class Logger( threading.Thread ): | |
def __init__( self, *args, **kwargs ): | |
threading.Thread.__init__( self ) | |
self.rtrSocket = None | |
self.stream = None |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
from IPython.frontend.qt.console.rich_ipython_widget import RichIPythonWidget | |
from IPython.frontend.qt.kernelmanager import QtKernelManager | |
from IPython.frontend.qt.inprocess_kernelmanager import QtInProcessKernelManager | |
from IPython.kernel.zmq.ipkernel import Kernel | |
from IPython.kernel.inprocess.ipkernel import InProcessKernel | |
from IPython.lib import guisupport | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from IPython.parallel import Client | |
from IPython.parallel import interactive | |
import time | |
import random | |
@interactive | |
def work(i): | |
import time | |
import random | |
sleeptime = 1 + random.random() * 2 |
OlderNewer