环境:Python3.5
[[email protected] 23:52:22~/test]# ll total 16 drwxr-xr-x. 2 root root 4096 Feb 22 22:45 sed -rwxr-xr-x. 1 root root 105 Feb 27 23:47 test01.py -rw-r--r--. 1 root root 41 Feb 27 23:48 test02.sh drwxr-xr-x. 2 root root 4096 Feb 27 23:36 tmp3 [[email protected] 23:52:25~/test]# cat test01.py #!/usr/bin/env python3 # -*- coding: utf-8 -*- s1 = 72 s2 = 85 r = s1/s2*100 print(‘rate= %0.2f%%‘ % r) [[email protected] 23:52:29~/test]# cat test02.sh #!/bin/bash python /root/test/test01.py [[email protected] 23:52:32~/test]# bash test02.sh rate= 84.71% [[email protected] 23:52:35~/test]#
时间: 2024-10-15 12:35:05