在其他主机上运行os.system

时间:2020-03-29 01:10:03

标签: python linux

是否可以在不同主机之间运行os.system?为了方便起见,我想将所有linux命令打包到一个python文件中,然后在我的计算机和外部板(珊瑚开发板)之间执行。但是,一旦我mdt shell(正在更改主机),代码就会停止,并且仅在我exit并返回起始主机时才继续。

carl@carl-IdeaPad-L340-15IRH-Gaming:~/code_fyp$ python3 code.py --cmd=pose
29/03/2020--08:39
Waiting for a device...
Connecting to fyp at 192.168.0.109
/home/carl/code_fyp/retrain
100% |>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>| /home/carl/code_fyp/retrain...
Waiting for a device...
Connecting to fyp at 192.168.0.109
|>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>| /home/carl/code_fyp/pose/si
100% |>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>| /home/carl/code_fyp/pose/si...
Waiting for a device...
Connecting to fyp at 192.168.0.109
Linux fyp 4.14.98-imx #1 SMP PREEMPT Fri Nov 8 23:28:21 UTC 2019 aarch64

The programs included with the Mendel GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.

Mendel GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.
Last login: Sun Mar 29 00:34:58 2020 from 192.168.0.110
mendel@fyp:
mendel@fyp:~$ exit
logout

Connection to fyp at 192.168.0.109 closed
mv: cannot stat 'simple_pose.py': No such file or directory
python3: can't open file '/home/carl/simple_pose.py': [Errno 2] No such file or directory
rm: cannot remove '/home/carl/simple_pose.py': No such file or directory
carl@carl-IdeaPad-L340-15IRH-Gaming:~/code_fyp$

0 个答案:

没有答案