在特定的Python文件上自动化TMUX会话创建。 (bash?)
我是所有这些服务器端内容的新手,并且我有一台服务器需要多次使用相同的Python脚本启动多个TMUX会话。
我如何自动化此过程(USIGN BASH等) 这是我目前要做的:
tmux / cd python /pyhon3 xshares.py / ctrl-b / d / tmux ...
一再,这需要大量时间,感谢您的帮助。
I am new to all this server side stuff, and I have a server on which I need to start up multiple tmux sessions with the same python script multiple times.
How can I automate this process,( usign bash etc)
This is what I do currently:
tmux / cd python /pyhon3 xshares.py / ctrl-b / d / tmux ...
Repeatedly, which takes a lot of time, thanks for your help.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我是2个开源的创建者,基于python的
tmux(1)
工具: libtmux 和 tmuxp 。tmux会话经理
如果我不得不猜测“自动化”,您正在寻找“ tmux Session Manager”。其中一些包括(非偏心):
这些工具的要旨是有一个声明性 yaml 配置封装了tmux会话它的窗户和窗格。
为了更好地了解这是什么样子,假设
mySession.yaml
:然后可以通过命令启动它(假设您通过
pip install -user tmuxp
)启动它:这将创建并自动将您启动到YAML文件中声明的TMUX会话中。这是一些示例以获取灵感。
脚本脚本tmux
我误解了我误解的外部机会 - 例如,您想以编程方式驾驶tmux,您可以通过shell命令执行此操作,以
tmux
本身或libtmux。最好问一个针对手册,脚本控制Tmux的问题。我也可以帮忙。 :)I'm creator of 2 open source, python-based
tmux(1)
tools: libtmux and tmuxp.tmux session managers
If I had to guess, by "automate" you are looking for a "tmux session manager". Some of those include (non-exhaustively):
The gist of these tools is there's a declarative YAML configuration encapsulating a tmux session, and its windows and panes.
To get a better idea what this looks like, assume
mysession.yaml
:You could then launch it via command (assuming you have tmuxp installed via
pip install --user tmuxp
):This will create and automatically launch you into the tmux session declared in the YAML file. Here are some examples for inspiration.
Scripting tmux
On the outside chance I misunderstood - e.g. you want to pilot tmux programmatically, you could do this through shell commands to
tmux
itself or libtmux. It could be better to ask a question pivoted toward manual, scripted control of tmux. I can help with that, too. :)