1
2
3
4
5
6
7
8
9
10
11
12
13
14
|
[root@bogon ~]
# cat file.py
#/usr/bin/env python
# coding: utf-8
ecs
=
"efwefwffrfrer"
ipaddrr
=
"192.168.56.10"
print
type
(ecs
+
" "
+
ipaddrr
+
" has stopeed"
)
def
write_result(
str
):
writeresult
=
file
(r
'/tmp/ecs.log'
,
'a+'
)
str1
=
writeresult.write(
str
+
'\n'
)
writeresult.close()
return
str
if
__name__
=
=
"__main__"
:
write_result(ecs
+
" "
+
ipaddrr
+
" has stopeed"
)
[root@bogon ~]
#
|
本文转自 小小三郎1 51CTO博客,原文链接:http://blog.51cto.com/wsxxsl/2068670,如需转载请自行联系原作者