在Shell 脚本里嵌入Python 发表于 2014-12-08 分类于 linux server , Python Disqus: [shell] #!/bin/bash function pytest() { python - $@ <<EOT import sys,datetime print ‘Current Time is %s’ % datetime.datetime.now() print sys.argv EOT } RT=$(pytest $@) echo my python script says: $RT [/shell]