最近由于工作项目原因,临时要求做一个局域网扫描软件。功能要求,扫描出IP地址以及对应的MAC地址。功能比较简单。于是很快就做了。采用的开发工具是 VB6.0
使用方法是通过发送 ARP包,广播 IP地址的方式来获得 对应的 MAC地址,SendARP()。
有一些细节要注意,就是 输出MAC地址的时候 如果不进行设置的话,就是002170A560F2。
如果要想输出为00-21-70-A5-60-F2这样的形式,可以
For i = 0 To length - 2
GetMac = GetMac & Right("00" & Hex(Mac(i)), 2) & "-"
Next i
GetMac = GetMac & Right("00" & Hex(Mac(5)), 2)
这样就可以可以了
还有一些其他功能就不做介绍了。 ......
'''gen_python_api.py generates a python.api file for SciTE
The generated api file includes
*) all Python keywords
*) all builtin functions
*) all module attributes
Module functions are represented by their docstring if available,
otherwise by the function definition from the source file.
Classes are represented by their constructor if available.
Usage:
Edit the list of modules which should be excluded. This list is located
some lines below. Look for excludemodulelist = [...]
Specify the modules whose contents should be added as global names
(i.e. from parrot import *). Look for addasgloballist = [...]
Start the script by typing 'python gen_python_api.py' in the shell.
Don't start it from within SciTE on Win32 systems, because some
modules need a TTY when they are imported.
Copy the generated python.api file into your SciTE directory and
add the following lines to your SciTEUser.properties file:
api.*.py=$(SciteDefaultHome)/python.api
api.*.pyw=$(SciteDefault ......
writeblog.csdn.net writeblog.csdn.net/PostEdit.aspx
这个程序很早以前就写过了,而且是参考的别人的写,具体谁的发在哪里我都忘记了。这里就算是半原创了,如有侵权请及时通知改正。
因为从今天1月1号开始,Google上订阅的天气预报服务已经取消了,估计是Google被施加压力了。反正是收不到天气预报了。正好重拾以前的那个脚本,自己设置抓取信息并发到手机就行了。
之前的脚本是用Python写的,抓的是新浪天气预报页面的信息,使用cocobear提供的PyFetion发送到自己手机上。上周拿来一运行,报error...
原来是飞信平台升级了,PyFetion也跟着升级了,而且新浪天气预报的页面也改版了。好嘛。。。
换用ip138提取的天气信息,重新改写如下
# -*- coding:utf-8 -*-
# file:weather.py
# by Lee, 2010-1-11
"""
抓取天气预报信息,并通过pyfetion发送短信通知
"""
import os
import re
import urllib
import sys
import time
from PyFetion import *
def GetWeather():
try:
# 获取网页源文件
sock = urllib.urlopen("http://qq.ip138.com/weather/guangdong/DongGuan.htm")
strhtml = sock.read()
strhtm ......
writeblog.csdn.net writeblog.csdn.net/PostEdit.aspx
这个程序很早以前就写过了,而且是参考的别人的写,具体谁的发在哪里我都忘记了。这里就算是半原创了,如有侵权请及时通知改正。
因为从今天1月1号开始,Google上订阅的天气预报服务已经取消了,估计是Google被施加压力了。反正是收不到天气预报了。正好重拾以前的那个脚本,自己设置抓取信息并发到手机就行了。
之前的脚本是用Python写的,抓的是新浪天气预报页面的信息,使用cocobear提供的PyFetion发送到自己手机上。上周拿来一运行,报error...
原来是飞信平台升级了,PyFetion也跟着升级了,而且新浪天气预报的页面也改版了。好嘛。。。
换用ip138提取的天气信息,重新改写如下
# -*- coding:utf-8 -*-
# file:weather.py
# by Lee, 2010-1-11
"""
抓取天气预报信息,并通过pyfetion发送短信通知
"""
import os
import re
import urllib
import sys
import time
from PyFetion import *
def GetWeather():
try:
# 获取网页源文件
sock = urllib.urlopen("http://qq.ip138.com/weather/guangdong/DongGuan.htm")
strhtml = sock.read()
strhtm ......
1 遍历文件夹和文件
import os
import os.path
# os,os.path里包含大多数文件访问的函数,所以要先引入它们.
# 请按照你的实际情况修改这个路径
rootdir = " d:/download "
for parent, dirnames, filenames in os.walk(rootdir):
# case 1:
for dirname in dirnames:
print ( " parent is: " + parent)
print ( " dirname is: " + dirname)
# case 2
for filename in filenames:
print ( " parent is: " + parent)
print ( " filename with full path : " + os.path.join(parent, filename))
......
Python 3 是 Guido van Rossum 功能强大的通用编程语言的最新版本。它虽然打破了与 2.x 版本的向后兼容性,但却清理了某些语法方面的问题。本文是系列文章中的第一篇,介绍了影响该语言及向后兼容性的各种变化,并且还提供了新特性的几个例子。
Python 版本 3,也被称为 Python 3000 或 Py3K(仿效 Microsoft® Windows® 2000 操作系统而命名的昵称)是 Guido van Rossum 通用编程语言的最新版本。虽然新版本对该核心语言做了很多改进,但还是打破了与 2.x 版本的向后兼容性。其他一些变化则是人们期待已久的,比如:
真正的除法 — 例如,1/2 返回的是 .5。
long 和 int 类型被统一为一种类型,删除了后缀 L。
True、False 和 None 现在都是关键字。
本文 — Python 3 系列文章中的第一篇 — 的内容涵盖了新的 print() 函数、input()、输入/输出(I/O)的变化、新的 bytes 数据类型、字符串和字符串格式化的变化以及内置的 dict 类型的变化。本文面向的是那些熟悉 Python 并对新版本的变化很感兴趣但又不想费力读完所有 Python Enhancement Proposal(PEP)的编程人员。(本文后面的 参考资料 部分提供了有关这些 PEP 的链接。)
新的 print() ......