LightTable / Python

Python language plugin for Light Table
MIT License
98 stars 51 forks source link

Remote python session #32

Open kdeu opened 9 years ago

kdeu commented 9 years ago

Hello -

Is there any way that I could configure LT to connect to a remote python session? Working with LT (0.7.2) on Windows 7, but developing over ssh to a unix server where my python lives.

Thanks!

kenny-evitt commented 9 years ago

@kdeu I'm sure there's some way to do this; I just don't know how exactly.

Would you do some research on this?

This code seems pertinent:

    if '--profile' in s:
        k,p = s.split('--profile')
        k = k.lstrip().rstrip() # kernel part of the string
        p = p.lstrip().rstrip() # profile part of the string
        fullpath = find_connection_file(k,p)
    else:
        fullpath = find_connection_file(s.lstrip().rstrip())

    km = KernelManager(connection_file = fullpath)
    km.load_connection_file()
    kc = km.client()
    kc.start_channels()
    send = kc.shell_channel.execute
    return km