Send commands from command line to a running Python script in Unix

前端 未结 2 1030
名媛妹妹
名媛妹妹 2021-02-06 12:45

I want to build a script that can be controlled while running from another scripts. For example I want to run my script like this:

~: Server &
2条回答
  •  星月不相逢
    2021-02-06 13:24

    So you need to talk to a running process right? What about the idea of unix domain socket?

    In your server you can build up a socket on a path of your unix file system, then talk to that socket in you client, like described in this link I googled:

    http://pymotw.com/2/socket/uds.html

提交回复
热议问题