2013-10-19 183 views
0

我需要在我的shell脚本(emailsend.sh)中调用python工具(buttons.py)。棘手的部分是这个python工具是用交互模式编写的。这就是我手动触发工具button.py:如何在shell脚本中运行交互式python脚本?

./button.py(它把用户在屏幕交互式控制台,并在其上,我需要键入以下:)

>>> tsr() 
>>> tl() 
>>> activate(355) 

有没有一种办法嵌入我的emailsend.sh脚本中的所有内容?

+0

如果Python脚本不是很长,上传到这里,你将得到更好的帮助。 – Oz123

回答

2

试试这个:

./button.py << EOF 
tsr() 
tl() 
activate(355) 
EOF