lixiaolong 发表于 2018-8-12 08:23:11

Python简单计算

# ll  
total 16
  
drwxr-xr-x. 2 root root 4096 Feb 22 22:45 sed
  
-rwxr-xr-x. 1 root root105 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
  
# cat test01.py
  
#!/usr/bin/env python3
  
# -*- coding: utf-8 -*-
  

  
s1 = 72
  
s2 = 85
  
r = s1/s2*100
  
print('rate= %0.2f%%' % r)
  
# cat test02.sh
  
#!/bin/bash
  

  
python /root/test/test01.py
  
# bash test02.sh
  
rate= 84.71%
  
#
页: [1]
查看完整版本: Python简单计算