2018年4月10日

将博客搬至CSDN

摘要: 将博客搬至CSDN 阅读全文

posted @ 2018-04-10 17:23 leonardhelloworld 阅读(118) 评论(0) 推荐(0) 编辑

2017年12月11日

当你在 python中 import不到模块的时候

摘要: 在 python中 import sys print sys.path 看一看模块的 引用路径 ,再看一看你的 模块路径 在不在这里面 rpm -ql 。。。。。你的模块(package) 如果不存在,那么就在 /etc/profile最后一行加上 export PYTHONPATH=$PYTHONPATH:你那个包的 路径 完成后保存退出 输入 source /etc/profile ... 阅读全文

posted @ 2017-12-11 20:59 leonardhelloworld 阅读(4189) 评论(0) 推荐(0) 编辑

sudo: pip: command not found in CentOS

摘要: vim /etc/sudoers 在 Defaults secure_path = /sbin:/bin:/usr/sbin:/usr/bin 后面添加上找不到的那条命令的路径,例如/usr/local/bin 所以修改成 Defaults secure_path = /sbin:/bin:/usr/sbin:/usr/bin:/usr/local/bin 阅读全文

posted @ 2017-12-11 20:54 leonardhelloworld 阅读(1674) 评论(0) 推荐(0) 编辑

2017年12月10日

Centos6.8初始部署

摘要: 升级python2.6到python2.7 系统时间的同步 阅读全文

posted @ 2017-12-10 20:56 leonardhelloworld 阅读(201) 评论(0) 推荐(0) 编辑

2016年12月12日

shell while循环体猜数字

摘要: #! /bin/bash echo "guest the num from 1 to 10" read num while [ $num != 5 ] do if [ $num -lt 5 ] then echo "Too small,try agin" read num elif [ $num -gt 5 ] then echo "Too large,try agin" read num fi... 阅读全文

posted @ 2016-12-12 22:46 leonardhelloworld 阅读(717) 评论(0) 推荐(0) 编辑

2016年12月11日

shell 使用Seq算出1-100的奇数之和

摘要: #! /bin/bash echo 计算出1-100的奇数之和 sum=0 for i in $( seq 1 2 100) do let "sum+=i" done echo result=$sum [root@lenny Desktop]# ./countjishu.sh 计算出1-100的奇数之和 result=2500 阅读全文

posted @ 2016-12-11 12:55 leonardhelloworld 阅读(1806) 评论(0) 推荐(0) 编辑

2016年12月10日

Shell脚本判断是否是闰年

摘要: #! /bin/bash echo -n Input year to judge if it is a leap year: read year let "y1=$year % 4" let "y2=$year % 100" let "y3=$year % 400" if [ ! "$y1" -eq 0 ] then leap=0 elif [ ! "$y2" -eq 0 ] then leap... 阅读全文

posted @ 2016-12-10 20:06 leonardhelloworld 阅读(4427) 评论(0) 推荐(1) 编辑

shell脚本之使用bc工具实现数值转换(浮点转二进制)

摘要: #! /bin/bash echo -n input float: read num echo power of the operation: echo $num^2 |bc echo converted to binary echo "obase=2;$num" |bc [root@lenny Desktop]# ./zhuanhuan.sh input float:3.1415... 阅读全文

posted @ 2016-12-10 12:51 leonardhelloworld 阅读(854) 评论(0) 推荐(0) 编辑

shell脚本之函数的参数

摘要: #! /bin/bash echo use function hello() { echo how many parameters in the function:$#; echo the name of this function is $0; echo the first parameters is :$1; echo the second parameters is :$2; } hel... 阅读全文

posted @ 2016-12-10 12:13 leonardhelloworld 阅读(6951) 评论(0) 推荐(0) 编辑

shell脚本之while

摘要: #! /bin/bash echo if num smaller than 5,it will continue num=0 while [ $num -lt 5 ] do echo now the num is $num let num++ done [root@lenny Desktop]# ./while.sh if num smaller than 5,it will c... 阅读全文

posted @ 2016-12-10 11:52 leonardhelloworld 阅读(211) 评论(0) 推荐(0) 编辑

导航