找个PYTHON程序给大家瞧瞧
import os
if os.name=='nt':
STPROFILE='c:/etc/syscheck.pf'
WEBPATH='c:\\etc\\web\\'
else:
STPROFILE='/etc/syscheck.pf'
WEBPATH='\\etc\\web\\'
import time
import smlib
import string
import srpc
import win32api
import thread
import traceback
from netman import *
syscheck_version='1.1'
threaddoing=[] #用于存放现在执行中的线程描述
file_lock=thread.allocate_lock()
threaddoing_lock=thread.allocate_lock()
sysname=smlib.getConfigStr(STPROFILE,'esys','name','landpage') #共用参数
# Logging support
# ===============
logfile = "" # Filename to log to, if not empty
logfp = None # File object to log to, if not None
def initlog(*allargs):
"""Write a log message, if there is a log file.
Even though this function is called initlog(), you should always
use log(); log is a variable that is set either to initlog
(initially), to dolog (once the log file has been opened), or to
nolog (when logging is disabled).
The first argument is a format string; the remaining arguments (if
any) are arguments to the % operator, so e.g.
log("%s: %s", "a", "b")
will write "a: b" to the log file, followed by a newline.
If the global logfp is not None, it should be a file object to
which log data is written.
If the global logfp is None, the global logfile may be a string
giving a filename to open, in append mode. This file should be
world writable!!! If the file can't be opened, logging is
silently disabled (since there is no safe place where we could
send an error message).
"""
global logfp, log
if logfile and not logfp:
try:
logfp = open(logfile, "a")
except IOError:
pass
if not logfp:
log = nolog
else:
log = dolog
apply(log, allargs)
def dolog(fmt, *args):
"""Write a log message to the log file. See initlog() for docs."""
global logfp
while 1:
if (file_lock.acquire(0)):
logfp.write(fmt%args + "\n")
logfp.close()
print '日志已记录,日志文件关闭!'
if logfile:
try:
logfp = open(logfile, "a")
print '日志文件打开!'
except IOError:
print '日志文件打开失败!'
pass
file_lock.release()
break
else:
time.sleep(1)
def nolog(*allargs):
"""Dummy function, assigned to log when logging is disabled."""
print '无日志记录!'
pass
log = initlog # The current logging function
def getcompproc():
## print 'getcompproc now!'
res=Getcompproc()
return res[0][1:],res[1][1:],res[2][1:],res[3][1:],res[4][1:]
def getdiskfree(path):
## print '---------------------------------'
## print '分区:',path,'磁盘空间情况!'
## print '---------------------------------'
res=Getdiskfree(path)
if res==None:
log( 'Args send wrong!--%s\r\n',getNowTime())
## if res[4]:
## logwrongmsg(res[4])
## return -1,-1
total=(res[0]*res[1]*res[3])/(1024*1024)
free=(res[0]*res[1]*res[2])/(1024*1024)
## print '每扇区段数:',res[0]
## print '每段字节数:',res[1]
## print '空扇区数:',res[2]
## print '扇区总数:',res[3]
## print '返回值:',res[4]
## print '\r\n'
print path
print '可用字节数:',res[0]*res[1]*res[2]
print '字节总数:',res[0]*res[1]*res[3]
return total,free
def add_stringname(name,add):
if name=='':
name+=add
else:
name+=','+add
return name
相关推荐
【雷达信号处理】数字下变频(DDC)(Matlab代码实现)
内容概要:本文介绍了基于MATLAB的雷达信号处理中数字下变频(DDC)技术的实现方法,重点阐述了DDC在雷达接收机前端信号处理中的关键作用。通过将高频回波信号下变频至基带,便于后续进行数字化处理与目标信息提取。文中提供了完整的MATLAB代码实现,涵盖混频、低通滤波、抽取等核心步骤,帮助读者理解DDC的工作原理与工程实现细节。; 适合人群:具备一定信号与系统、数字信号处理基础知识,从事雷达、通信或电子工程相关领域的研究生、科研人员及工程技术人员。; 使用场景及目标:①用于教学演示,加深对数字下变频原理的理解;②作为雷达或通信系统仿真项目的基础模块;③辅助科研人员快速搭建信号处理链路,进行算法验证与性能分析。; 阅读建议:建议结合数字信号处理教材中的混频、奈奎斯特采样及多速率信号处理理论进行学习,动手运行并调试代码,尝试调整参数(如本振频率、滤波器阶数、抽取因子)以观察对输出信号的影响,从而深入掌握DDC的设计要点与实际应用。
福建省福州新区矢量面数据-02坐标-geojson格式.json
福州新区区划面数据,geojson格式,02坐标
量化数据笔记第2篇:外盘期货历史高频tick数据涵盖主流交易所的活跃合约,以逐笔成交记录为主 字段通常包含品种代码、交易所、日期、精确到毫秒的时间戳、成交价格、成交量、持仓量变化,以及盘口买卖一档挂单
量化数据笔记第2篇:外盘期货历史高频tick数据涵盖主流交易所的活跃合约,以逐笔成交记录为主。字段通常包含品种代码、交易所、日期、精确到毫秒的时间戳、成交价格、成交量、持仓量变化,以及盘口买卖一档挂单价与挂单量。数据保留了原始行情序列,反映微观价格变动与流动性瞬时变化。 数据源:CMES金融数据库
【多机器人路径规划】基于优先级规划与Petri网融合的多机器人路径规划框架研究(Matlab代码实现)
内容概要:本文提出了一种基于优先级规划与Petri网融合的多机器人路径规划框架,旨在解决多机器人系统在共享环境中进行路径规划时可能出现的冲突与死锁问题。该方法结合了优先级规划的高效性与Petri网在建模并发与冲突方面的优势,通过建立形式化的Petri网模型对机器人运动状态进行精确描述,并引入优先级机制动态调整路径执行顺序,从而实现无冲突、无死锁的安全路径规划。研究通过Matlab代码实现了算法仿真,验证了该框架在复杂网格环境下的可行性与有效性,能够有效提升多机器人系统的运行效率与安全性。 适合人群:具备一定自动化、机器人或控制理论基础的科研人员,以及从事智能物流、智能制造、多智能体系统等相关方向的研究生与工程技术人员。 使用场景及目标:①应用于仓储机器人、AGV调度、自动化码头等多移动机器人协同作业场景;②解决多机器人路径规划中的死锁预防、冲突消解与资源竞争问题;③为开发高效、可靠的多智能体路径规划系统提供理论支持与实现参考。 阅读建议:此资源以Matlab代码实现为核心,建议读者在理解Petri网基本原理和优先级调度机制的基础上,结合提供的代码进行仿真实验,通过调整优先级规则与网络结构,深入掌握算法的设计思路与优化方法。
碰碰炸挤黑单机游戏,好玩
碰碰炸挤黑单机游戏,好玩


