In [2]:
%load_ext autoreload
%autoreload 2
import os
import sys
# Get current Directory
wd = os.getcwd()
# Add package to path
sys.path.append('C:\\Dev\\BiiGTK\\src\\SlicerModules\\SordinaLIACGuidance\\OpenIGTLink')

import OpenIGTLink

messagefile = 'c:\\users\\emarin~1\\appdata\\local\\temp\\tmpmgiwwb'
server = OpenIGTLink.OpenIGTLinkConnection(connectionType = 'server')
server.loadFileMessages(messagefile)
server.connect()
server.startSending(120)


The autoreload extension is already loaded. To reload it, use:
  %reload_ext autoreload
Trying to Read Message File
File Readed. Number of read messages: 50
Trying to connect
Socket Created
Ip address of localhost is 127.0.0.1
Connecting as a server. Waiting for connections...
Thread Called:  1  times
Sending time to finish: Press Ctrl + C for end server [15:00:55]--[|                   ]Adding new connection at 54270
Sending time to finish: Press Ctrl + C for end server [15:01:15]--[||||                ]Adding new connection at 54277
Sending time to finish: Press Ctrl + C for end server [15:01:26]--[||||||              ]* One link removed
Sending time to finish: Press Ctrl + C for end server [15:02:51]--[||||||||||||||||||||] Finished!

In [ ]:
import sys
sys.stdout.write('hola')
sys.stdout.write(' esto')

In [ ]:
server.disconnect()

In [ ]: