Raspbian Buster:强制启动Python脚本的终端窗口@启动

问题描述 投票:0回答:1

在RPi3B +上运行Raspbian Buster。

在/ etc / xdg / lxsession / LXDE-pi上运行良好的自动启动,该启动会调用一个名为launcher.sh的bash脚本:

#!/bin/bash -x

sleep 10  # Just giving time for other stuff to settle in.
/usr/bin/python3 /home/pi/Desktop/HOSTCORE/SpeechCenter.py &
#Listens (binds) to :5555 for speech to input
sleep 55

/usr/bin/python3 /home/pi/Desktop/HOSTCORE/visionCommandTest.py
#Talks to :5555 for speech to output
sleep 10

第一次对SpeechCenter.py的调用在后台运行时效果很好,并且系统宣布已连接到语音中心。

我需要第二个调用visionCommandTest.py才能在终端窗口中运行,因此用户可以输入文字让系统讲话,但该命令不会打开终端窗口。该命令之所以有效,是因为ps -ax揭示了python visionCommandTest.py正在运行(在这种情况下)为“ PID 934 pts / 0 Tl”-但是,如果没有打开终端窗口,就无法进行用户输入。 (此外,SpeechCenter.py的PID显示为“ 911?Sl” ...所以它们在我的ps -ax列表中的显示方式肯定存在差异)

只需知道如何告诉bash脚本打开终端窗口,然后在其中运行visionCommandTest.py ...

谢谢!

python bash terminal autostart raspbian-buster
1个回答
0
投票
猜猜您可能已经解决了,但是我只是解决了这个问题。我已经为类似问题添加了答案。您会在这里找到我的答案。https://stackoverflow.com/a/61730679/7575617它对我有用。
© www.soinside.com 2019 - 2024. All rights reserved.