[root@bogon ~]# python tt.pyserver1server2[root@bogon ~]# bash a.sh server01server02
[root@bogon ~]# cat a.sh #!/bin/bashserver="server01 server02"for i in ${server}do echo ${i}done[root@bogon ~]# cat tt.py #!/usr/bin/env pyhton #encoding:utf-8def do(): arry = ["server1","server2"] for i in arry: print(i)if __name__ == "__main__": do() [root@bogon ~]#