http://win32com.goermezer.de/content/blogsection/7/284/

一个网站,有各种Windows 下使用 Python 的脚本示例,很不错,有待继续挖掘。

举一个例子:

https://win32com.goermezer.de/content/view/287/285/

import win32com.client
# look in the makepy output for IE for the 'CLSIDToClassMap'
# dictionary, and find the entry for 'ShellWindows'
clsid='{9BA05972-F6A8-11CF-A442-00A0C90A8F39}'
ShellWindows=win32com.client.Dispatch(clsid) # a busy state can be detected:
# while ShellWindows[0].Busy == False:
# go in for-loop here for i in range(ShellWindows.Count):
print ShellWindows[i].LocationURL
for j in range(ShellWindows[i].Document.SelectedItems().Count):
print ' ', ShellWindows[i].Document.SelectedItems().Item(j).Path # Be careful: Internet Explorer uses also the same CLSID. You should implement a detection!

这段代码获取当前打开Windows Explorer窗口的名字,以及选中的文件,是不是有种黑科技的感觉呀!

资源:Python for Windows的更多相关文章

  1. 使用Python写Windows Service服务程序

    1.背景 如果你想用Python开发Windows程序,并让其开机启动等,就必须写成windows的服务程序Windows Service,用Python来做这个事情必须要借助第三方模块pywin32 ...

  2. python 基于windows环境的ftp功能

    描述: 1.基于备份服务器部署的py程序,将需要备份主机目录下的内容下载至备份服务器(服务端和远端都是windows server 2008) 2.py程序部署在windows服务器,后台运行,基于b ...

  3. 关于Python 获取windows信息收集

    收集一些Python操作windows的代码 (不管是自带的or第三方库)均来自网上 1.shutdown 操作 定时关机.重启.注销 #!/usr/bin/python #-*-coding:utf ...

  4. python安装(windows)

    1.python安装(windows) 1.1 下载安装包 https://www.python.org/downloads/ 1.2 安装 python2.7默认安装路径:C:\python27 注 ...

  5. Python入门-----Windows安装

    摘要:Python,windows安装 1.进入python的官方网站下载:https://www.python.org 点击Download,选择windows版本:

  6. python在windows(双版本)及linux环境下安装

    python下载 下载地址:https://www.python.org/downloads/ 可以下载需要的版本,这里选择2.7.12和3.6.2 下面第一个是linux版本,第二个是windows ...

  7. Python做windows服务

    Python做windows服务(多进程服务),并结束多进程 Python中_,__,__xx__的区别 在注册MyWinService服务时,再使用 "sc delete 服务器名称&qu ...

  8. python 在windows下的 虚拟环境

    解决 python 环境问题 windows 下安装 pip install virtualenv virtualenv的基本使用 1.1 创建虚拟环境 virtualenv venv 为环境指定Py ...

  9. python实现windows Service服务程序

    python实现windows Service服务程序 win32serviceutil.ServiceFramework是封装得很好的Windows服务框架,本文通过继承它来实现. 通过SvcDoR ...

  10. 【Python】Windows平台下Python、Pydev连接Mysql数据库

    Mysql数据库是跨平台的,不是说Python一定就要连接Mongodb. Python连接Mysql数据库是非常easy的. 首先,你要配置好Python的开发环境,详见<[Python]Wi ...

随机推荐

  1. Query Designer:变量的偏移 Variable Offset

    声明:原创作品,转载时请注明文章来自SAP师太技术博客( 博/客/园www.cnblogs.com):www.cnblogs.com/jiangzhengjun,并以超链接形式标明文章原始出处,否则将 ...

  2. php : 基础(1)

    php基本语法形式 1.php的标记符 有以下形式: 形式1(推荐): <?php 这里要写符合php语法的语句 ?> 形式2: <script language="php ...

  3. angularjs指令系统系列课程(5):控制器controller

    这一节我们来说一下controller这个参数 一.指令控制器的配置方法: 对于指令我有两种配置路由的方式:1.在html中直接引用,2,在指令的controller参数里定义 第一种:在html中直 ...

  4. Distributed Databases and Data Mining: Class timetable

    Course textbooks Text 1: M. T. Oszu and P. Valduriez, Principles of Distributed Database Systems, 2n ...

  5. C语言的总结

    在C语言考试的中,我成绩不是很好,其实在学习C语言的时候我没有好好去学过,我知道了是我自己的错误,我不应该抱着侥幸的心里去上课的,我会去好好听课的哦l

  6. Java注释@interface的用法【转】

    Java用  @interface Annotation{ } 定义一个注解 @Annotation,一个注解是一个类.@Override,@Deprecated,@SuppressWarnings为 ...

  7. OpenBSD之开篇

    对BSD有特殊的情节,早在大学的时候最初迷恋FreeBSD,还记得第一个折腾的版本是5.x,后来组件转到折腾Linux,但那份情节还是在心底,再加上越发觉得Linux的一盘散沙和BSD的完整性形成鲜明 ...

  8. css中左侧固定,右侧自适应

    谈谈我开始出来工作时候的一道面试题吧 当初我记得在太平洋网络面试的时候,面试官给我出了这么一道题: 有一个外层的div 中间有左右两个div 要求左侧的div 1.只告诉你宽度;       2.只告 ...

  9. get github

    Git是一个分布式的版本控制系统,最初由Linus Torvalds编写,用作Linux内核代码的管理.在推出后,Git在其它项目中也取得了很大成功,尤其是在Ruby社区中.目前,包括Rubinius ...

  10. Jaxb annotation使用

    JAXB(Java Architecture for XML Binding) 是一个业界的标准,是一项可以根据XML Schema产生Java类的技术.该过程中,JAXB也提供了将XML实例文档反向 ...