Can you run a python websocket server in VS

Hello

I am trying create a websocket server in the integrated python terminal from the Modelling Tab → Behaviours → Misc → Python script

websockets · PyPI - the package I am trying to use

I know its possible to have a TCP/IP socket script in VC from import sockets but is there any websocket capabilites in VC? Any already available package that can be used in VC for python?

Thanks

VC 4.8 uses stackless Python 2.7 which is integrated into the application. Generally you can only use pure Python 2 libraries, so no C modules or other binary dependencies.

For web sockets you could try this old library:

Thanks for the reply

How do I use this library and access it from the integrated python editor from the modelling tab?

would

from ws4py import *

just work?

I get ImportError: No module named ws4py

Hi svk,

Could you download the library and then put it to:
C:\Program Files\Visual Components\Visual Components <version>\Python\lib

and try again? Your installation PATH may vary. Once the library is there, you should be able to access it via the python script of VC (with import).

br,
Lefa