IE浏览器打开C盘,测试可用. 如果浏览器报错提示:ActiveXObject is not defined Internet 选项 -> 安全 - >安全级别,调低级别 function openFileIIs(){ try{ var obj=new ActiveXObject("wscript.shell"); if(obj){ obj.Run("c:/", 1, false ); //obj.run("osk");/*打开屏幕键
删除本地文件夹: import os , string , datetime ; str = '/home/niuguoqin/tmp/tomcat/'; b = (datetime.datetime.now()).second + 5; while 1 : a = datetime.datetime.now(); if a.second == b : files = os.listdir(str); for file in files : os.remove(str+file); b = (a
Python模糊查询本地文件夹去除文件后缀 import os,re def fuzzy_search(path): word= input('请输入要查询的内容:') for filename in os.listdir(path): #遍历指定文件夹 re_filename = re.findall('.\w+', str(filename)) #去除文件后缀名 if word in re_filename[0]: print(re_filename[0])