- 博客(26)
- 资源 (10)
- 收藏
- 关注
转载 Python 获得命令行参数的方法
Python 获得命令行参数的方法本篇将介绍python中sys, getopt模块处理命令行参数如果想对python脚本传参数,python中对应的argc, argv(c语言的命令行参数)是什么呢?需要模块:sys参数个数:len(sys.argv)脚本名: sys.argv[0]参数1: sys.argv[1]
2016-04-01 14:36:49
446
原创 verify who reload the lab with shell
#!/bin/kshif [[ "${1}" = "" ]]then print "\nEnter labname: \c" read LABelse LAB="${1}"fiif [[ ! -f /home/fsbu/logs/reloadlog-${LAB} ]]then print "\nInvalid labname
2015-06-30 09:41:03
412
原创 compute the su procedure time with python
#!/usr/bin/python2.6import re,datetimefile_name='sim.log'file=open(file_name,'r')acnum=[];time_res=[];lnum=0def trans_time(time): t1=datetime.datetime.strptime(time,'%y/%m/%d %H:%M:%S')
2015-06-30 09:39:26
686
原创 tools save the logs during su procedure
"ts" 5 lines, 235 characters #!/bin/bash#logsaver tat07 2 apply-comit-backout-bld1 R2711.01.38#logsaver tat04 2 apply-reapply-commit-so-bld3 R2860.01.26logsaver qisc2 2 apply-commit-backout-b
2015-06-30 09:37:16
716
原创 generate hss profile via shell
#!/bin/kshprintf "data generation is beginning ...\n"#rm -rf pstn2ue_dataorig_num=6002042001printf "SEQUENTIAL# USER; AUTHENTICATION; local Port; Media Port\n">reg_datafor ((i=0;ido
2015-06-30 09:34:36
403
原创 generate the call load file
#!/usr/bin/perl -w$e911_call_percent = 0.0;$ims_node_number = 12;$local_ip = "10.86.52.2";$local_port_base = 18000;$media_port_base = 19000;$SIPP_BIN="/home/lss/QCBCb/bin/sipp";$
2015-06-30 09:27:08
681
原创 oil spill areas mark
clear all;datasub=imread('c:\Users\Administrator\Desktop\dark_spots.png');[row,col] = size(datasub);flag = zeros(row,col);flag=datasub;figure,imagesc(imadjust(flag)),colormap(gray),title('SA
2014-11-11 22:38:48
719
1
原创 利用python 提取log 文件中的关键句子,并进行统计分析
利用python开发了一个提取sim.log 中的各个关键步骤中的时间并进行统计的程序:#!/usr/bin/python2.6import re,datetimefile_name='/home/alzhong/logs/qtat1/R2860.01.13/sim-applycommitrollback-bld1.log'file=open(file_name,'r')acnum=[
2014-06-25 11:07:34
6888
原创 分割RGB中物体并计算数目
I=imread(im_path); axes(handles.axes1); imshow(I),% title('原始图像'); %计算每个像素点的真实长度 [x,y]=ginput(2); length=str2double(get(handles.edit5,'st
2014-06-05 18:24:05
1090
原创 利用matlab提取并分割RGB图像中的某一个已知像素值的图像
已知一副RGB图像中的的像素值,利用matlab将其分割出来并以二进制图像形式显示:%extract.mclear all;I=imread('new_original.png');figure,imshow(I),title('Original Image');bw=im2bw(I,0.3);%figure,imshow(bw),title('Gray Image');rgb=[
2014-05-29 23:16:43
9399
2
原创 matlab 2014a 改为英文版本
1. 在 Matlab 的安装目录下面找到如下的路径,X:\MATLAB\R2014a\java\jar,其中 X 为安装盘符,这个不用过多解释了,然后找到文件夹 zh_CN,此文件夹就是中文界面的语言包,可以将此文件夹改成其他的名字,总之不能是 zh_CN,就OK了,以后想用中文界面的时候还可以改回来。本方法不足在于命令行为中文,而且有网友反映过一段时间还会自动改回中文。2. 添加系统变量
2014-05-29 07:04:27
6025
原创 matlab 修改rbg图像中指定范围内像素点的rgb值
function imgto=color_mark(img, diam,color_to )%UNTITLED2 Summary of this function goes here% img is input image which is a rgb image% diam is a pixel scale in image [208,313,375,705]; [208 313
2014-05-24 18:24:57
11274
原创 ASP.NET web express中使用arcgis sliverlight
1. 在visual studio 2013 工具扩展中搜ESRI,选择合适的模版安装2. 项目新建,刚刚安装的模版3. 通常会报一个错误,interactions的4. 工具-》nugit程序管理包,搜索interactivity 进行安装(这里需要使用IE打开,否则会报一个指针错误)
2014-05-04 13:00:13
871
原创 sulogsaver with shell and expect
1. comand:#!/bin/bashlogsaver tat07 1 applycommit-test-abc R2618.01.222. main script:#!/bin/bashtat07=(tat07 135.2.85.98 135.2.85.99 4)tat04=(tat04 135.1.68.238 135.1.68.239 4)qtat1=(qtat1 135
2014-03-12 10:09:23
767
原创 auto deft involve data with shell
#!/bin/bashautodef R29.13.50 R29.13.55 dbload_13.50 135.1.68.98#!/bin/bash #####################################define the param####################################data=$3host=$4username="l
2014-03-11 10:11:09
605
原创 计算sim.log 的各个点的时间
#!/usr/bin/pythonimport sys, refile=open('/storage/sim/log/update/sim.log','r')begin_flag=cpw_flag=vs_flag=0resume_flag=commit_flag=end_flag=0for line in file: if(re.search("BEG
2013-11-21 09:35:45
872
转载 Bring up lab --from Leo Li
#! /usr/bin/env python'''@File: bringup.py@Author: Leo Li@Version: 1.0'''import telnetlibimport loggingimport sysimport stringimport reimport timeimport threadimport osimport ftplibim
2013-11-05 16:01:46
848
原创 generate IFC profile with python
for num in range(1,65001):#!/usr/bin/pythonout_file = open("profile_data","w+")num=0ll=5flag=1 for num in range(1,65001): out_file.write("\n# trigger for invite and register b2b AS\n"+'%d'%fla
2013-11-01 17:53:55
1137
原创 循环显示CNFG status with python
#!/usr/bin/pythonimport os,syscmd="FScmd state cnfg vc"cmd2="sleep 2"cmd3="print $(date) cnfg switch|tee -a cnfg_status.log"for i in range(5000): os.system(cmd) os.system(cmd2)
2013-11-01 17:47:14
534
原创 一个用Python 在linux下批量文件名和去掉linux文件中^M的脚本
今天帮同事用Python写了一个小工具,实现了在linux下批量文件名和去掉windows 文件到linux过程中产生^M的脚本,代码如下:#!/opt/exptools/bin/pythonimport os,os.path,sysimport shutil,stringdir ='/home/alzhong/tools/zch/filedir'for i in os.
2013-10-10 11:18:11
2215
原创 对 autoscape case 报告的统计
#-*- coding: utf-8 -*-# Filename: try_except.pyimport sysimport csv#generate the cases for certain release and statusdef reporter_for_rel(rel,status,func): num_func=0 for line in reader: if line[8] ==
2013-09-29 17:32:05
549
转载 Redis及phpredis安装配置
Redis及phpredis安装配置分类: Mysql/Redis/Memcached 2013-07-09 16:07279人阅读 评论(0)收藏 举报1,安装Redis1.1,下载及安装wget http://redis.googlecode.com/files/redis-2.6.14.tar.gztar -zxvf redis-2.6.1
2013-08-17 04:06:03
537
原创 c/c++ unsigned char 的学习
unsigned char a=257;int(a)=1;//257-256unsigned char a=-1;int(a)=255; //256-1unsigned char a=-257;int(a)=255;//256-1
2013-06-27 15:20:15
775
原创 python 获取文件夹下所有文件大小
#python 获取文件夹下所有文件大小import osfrom os.path import join, getsizedef getDirSize(dir): size = 0L for root, dirs, files in os.walk(dir): for filespath in files: pri
2013-06-04 22:09:13
1553
数据结构与算法分析(英文C版)高清 pdf
2013-07-24
ATL Internals: Working with ATL 8, Second Edition
2011-06-14
envi 教程(适用于初学者)
2009-05-11
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人