Python
ysdaniel
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
python中调用shell
python中调用shell 转:http://blog.sina.com.cn/s/blog_5357c0af0100yzet.html 1.1 os.system(command) 在一个子shell中运行command命令,并返回command命令执行完毕后的退出状态。这实际上是使用C标准库函数system()实现的。这个函数在执行command命令时需要重转载 2012-08-25 00:15:46 · 1695 阅读 · 0 评论 -
python 获取脚本传递参数 及参数个数 检查文件 变量 是否存在 退出脚本
python获取脚本传递参数:import sysprint sys.argv[0] ##脚本名print sys.argv[1] ## 第一个参数print sys.argv ###参数数组print len(sys.argv) ##参数个数python 检查文件是否存在:import osas_uniq_info="/home/mtr_dir/auto_mt原创 2012-09-27 19:12:30 · 63121 阅读 · 0 评论 -
python按行读取文件 去掉换行符"\n"
eg:#! /usr/bin/pythonimport sysimport stringimport osbase_dir="/home/qinjianwang/mtr_dir/2012_09_12/tw"as_uniq_info=base_dir + "/as_uniq_info"get_line_num="wc -l " + as_uniq_info + " | awk '{p原创 2012-09-12 14:14:59 · 127298 阅读 · 2 评论 -
python 调用 shell python shell 间变量传递
python -> shell:1.环境变量[python] view plaincopyprint?import os var=123或var=’123’ os.environ[’var’]=str(var) #environ的键值必须是字符串 os.system(’echo $var’) import osvar=1转载 2012-09-12 14:23:25 · 26523 阅读 · 1 评论 -
Python 安装 MaxMind GeoLite City
1、先安装 geoip c library geoip c library >= 1.4.6 installed on your machine. >= 1.4.6 installed on your machine.wget http://geolite.maxmind.com/download/geoip/api/c/GeoIP-1.4.7.tar.gztar -xvzf GeoIP原创 2014-05-12 10:56:53 · 5362 阅读 · 1 评论
分享