摘要:
#-*- coding: UTF-8 -*- import urllib2, re,datetime,time, os,sys from PIL import Image, ImageDraw, ImageFont from math import atan, degrees # #图片下载类 #功能:下载图片,生成缩略图,生成水印图 # class dow...
阅读全文
posted @ 2011-10-19 19:30
方倍工作室
阅读(585)
推荐(0)
摘要:
# -*- coding: utf-8 -*-"""some function by metaphy,2007-04-03,copyleftversion 0.2"""import urllib, httplib, urlparseimport reimport random"""judge url exists or not,by others"""def httpExists(url): ...
阅读全文
posted @ 2011-10-19 19:29
方倍工作室
阅读(1270)
推荐(0)
摘要:
python中对文件、文件夹的操作需要涉及到os模块和shutil模块。 创建文件: 1) os.mknod("test.txt") 创建空文件 2) open("test.txt",w) 直接打开一个文件,如果文件不存在则创建文件 创建目录: os.mkdir("file") 创建目录 复制文件...
阅读全文
posted @ 2011-10-19 19:27
方倍工作室
阅读(311)
推荐(0)
摘要:
1: #NS2_有线部分\homework03.tcl 2: 3: #Create a simulator object 4: set ns [new Simulator] 5: 6: #Define different colors for data flows 7: $ns color 1 Blue 8: $ns color 2 Red 9: 10: #Open the nam trace file 11: set nf [open szsh.nam w] 12: $ns namtrace-all $nf 13: 14: #Open the trace reco...
阅读全文
posted @ 2011-10-13 12:44
方倍工作室
阅读(286)
推荐(0)
摘要:
1: #NS2_有线部分\homework02.tcl 2: 3: #Create a simulator object 4: set ns [new Simulator] 5: 6: #Define different colors for data flows 7: $ns color 1 Blue 8: $ns color 2 Red 9: 10: #Open the nam trace file 11: set nf [open szsh.nam w] 12: $ns namtrace-all $nf 13: 14: #Open the trace reco...
阅读全文
posted @ 2011-10-13 12:38
方倍工作室
阅读(351)
推荐(0)
摘要:
1: #NS2_有线部分\homework01.tcl 2: 3: #创建两个结点,深圳到北京的TCP连接,图形将数据显示出来,计算吞吐率,画图分析 4: #tcp上层用ftp 5: #udp上层用cbr 6: #Create a simulator object 7: set ns [new Simulator] 8: 9: set nf [open SZ2BJ.nam w] 10: $ns namtrace-all $nf 11: 12: set nd [open SZ2BJ.tr w] 13: $ns namtrace-all $nd 14: 15: proc...
阅读全文
posted @ 2011-10-13 12:37
方倍工作室
阅读(306)
推荐(0)
摘要:
1: #NS2_有线部分\ForGnuplot.plot 2: 3: #gnuplot> 4: #set xtics 0, 1, 10 5: set grid 6: set xrange [0:10] 7: set yrange [0:1000] 8: set key top left set key bottom right 9: set key box 10: set title "TCP Throughput" 11: set xlabel "Time(s)" 12: set ylabel "Throughput(kb)"
阅读全文
posted @ 2011-10-13 12:35
方倍工作室
阅读(407)
推荐(0)
摘要:
1: #NS2_有线部分\Throughput.awk 2: 3: BEGIN { 4: #Initialize the variable 5: init = 0; 6: i = 0; 7: } 8: 9: { 10: #Event Abbreviation Type Value 11: #%g %d %d %s %d %s %d %d.%d %d.%d %d %d 12: #Normal Event 13: #r: Receive 14: #d: Drop 15: #e: Error 16: ...
阅读全文
posted @ 2011-10-13 12:34
方倍工作室
阅读(357)
推荐(0)
摘要:
1: #NS2_有线部分\LossRate.awk 2: 3: BEGIN { 4: #Initialize the variable 5: Lost = 0; #the Sum of Lost packet 6: Send = 0; #the Sum of Send packet 7: } 8: 9: { 10: #Event Abbreviation Type Value 11: #%g %d %d %s %d %s %d %d.%d %d.%d %d %d 12: #Normal Event 13: #r...
阅读全文
posted @ 2011-10-13 12:33
方倍工作室
阅读(1175)
推荐(0)
摘要:
关键字:WinPcap 网卡 MAC地址作者:txw1958在WpdPack_4_1_2\WpdPack\Examples-remote\PacketDriver\GetMacAddress\目录下有获取MAC地址源文件GetMacAddress.c 1: /* 2: * Copyright (c) 1999 - 2005 NetGroup, Politecnico di Torino (Italy) 3: * Copyright (c) 2005 - 2006 CACE Technologies, Davis (California) 4: * All rights re...
阅读全文
posted @ 2011-10-13 12:32
方倍工作室
阅读(8459)
推荐(0)
摘要:
1: #NS2_有线部分\EndDelay.awk 2: 3: BEGIN { 4: #Initialize the variable 5: MaxID = 0; 6: i = 0; 7: } 8: 9: { 10: #Event Abbreviation Type Value 11: #%g %d %d %s %d %s %d %d.%d %d.%d %d %d 12: #Normal Event 13: #r: Receive 14: #d: Drop 15: #e: Error 16: ...
阅读全文
posted @ 2011-10-13 12:31
方倍工作室
阅读(860)
推荐(0)
摘要:
关键字:IP地址 正则表达式作者:txw1958出处:http://www.cnblogs.com/txw1958/archive/2011/10/13/ip_address_regular_expression.html IP地址的长度为32位,分为4段,每段8位,用十进制数字表示,每段数字范围为
阅读全文
posted @ 2011-10-13 12:30
方倍工作室
阅读(131632)
推荐(4)
摘要:
1: echo %time% 2: 3: 4: rem ** ipc and mapping 5: c: 6: net use x: /del 7: net use y: /del 8: net use \\10.11.44.1\ipc$ /del 9: echo ============================================== 10: net ...
阅读全文
posted @ 2011-10-13 12:28
方倍工作室
阅读(259)
推荐(0)
摘要:
第二十二章、 其它应用 1) Web服务 ##代码 s 000063.SZ ##开盘 o 26.60 ##最高 h 27.05 ##最低 g 26.52 ##最新 l1 26.66 ##涨跌 c1 -0.04 ##涨幅 p2 -0.15% ##总手 v 9190865 ##日期 d1 6/15/2011 ##时间 t1 3:00am #!/usr/bin/env python from time import ctime from urllib import urlopen import re ti...
阅读全文
posted @ 2011-10-13 12:28
方倍工作室
阅读(969)
推荐(0)
摘要:
1: rem "D:\Microsoft Visual Studio 8\SDK\v2.0\Bin\sdkvars.bat" 2: D: 3: cd ..\..\..\..\..\..\..\..\..\..\..\..\ 4: cd "D:\Microsoft Visual Studio 8\SDK\v2.0\Bin" 5: 6: @Set Path=D:\Micros...
阅读全文
posted @ 2011-10-13 12:27
方倍工作室
阅读(310)
推荐(0)
摘要:
第二十一章、 扩展Python /* D:\Python27\Lib\Extest-1.0\Extest2.c */ #include <stdio.h>#include <stdlib.h>#include <string.h> #include "Python.h" int fac(int n){ if (n < 2) return(1); return (n)*fac(n-1);} static PyObject *Extest_fac(PyObject *self, PyObject *args){ int num; if
阅读全文
posted @ 2011-10-13 12:27
方倍工作室
阅读(322)
推荐(0)
摘要:
第二十章、 数据库编程 环境设置 1).安装MySQL-python http://www.lfd.uci.edu/~gohlke/pythonlibs/ MySQL-python-1.2.3.win32-py2.7.exe 1) 使用数据库接口 import MySQLdb cxn = MySQLdb.Connect(host = '127.0.0.1', user = 'root', passwd = 'root') cur = cxn.cursor() try: cur.execute("DROP DATABASE test610
阅读全文
posted @ 2011-10-13 12:26
方倍工作室
阅读(533)
推荐(0)
摘要:
1: subst t: /d 2: subst t: D:\PublicViews\Automation_Framework\SQA_ATE_DEV 3: 4: rem ** update folders 5: t: 6: cd ..\..\..\..\..\..\..\..\..\..\..\..\ 7: 8: rmdir /s /q "t:\_updated_jimm...
阅读全文
posted @ 2011-10-13 12:25
方倍工作室
阅读(285)
推荐(0)
摘要:
第十九章、 图形界面编程 import Tkintertop = Tkinter.Tk() hello = Tkinter.Label(top, text='Hello World!')hello.pack()quit = Tkinter.Button(top, text='QUIT',command=top.quit)quit.pack(fill=Tkinter.X, expand=1) Tkinter.mainloop()
阅读全文
posted @ 2011-10-13 12:23
方倍工作室
阅读(339)
推荐(0)
摘要:
第十八章、 Web编程 import urllib2 LOGIN = 'jin'PASSWD = 'Welcome'URL = 'https://tlv-tools-qc:8443/qcbin/start_a.htm'def handler_version(url): from urlparse import urlparse as up hdlr = urllib2.HTTPBasicAuthHandler() hdlr.add_password('Archives', up(url)[1], LOGIN, PASSWD) op
阅读全文
posted @ 2011-10-13 12:22
方倍工作室
阅读(462)
推荐(0)