小编Dav*_*vid的帖子

如何在 Python 中从 Windows 7 遍历连接的 iPhone 上的照片?

当我将我的 iPhone 连接到我的 Windows 7 系统时,Windows 资源管理器打开一个虚拟文件夹到 DCIM 内容。我可以通过 Pywin32 (218) 访问 shell 库接口,如下所述:Can I use library abstractions in python?

给定一个在 Windows 资源管理器中工作的面向用户的编辑路径 (SIGDN_DESKTOPABSOLUTEEDITING),并启动 Windows 照片查看器:

电脑\我的 iPhone\内部存储\DCIM\828RTETC\IMG_2343.JPG

如何获取解析路径 (SIGDN_DESKTOPABSOLUTEPARSING) 以与 SHCreateItemFromParsingName() 一起使用以创建 ShellItem?(从中我将绑定一个流并复制到本地磁盘,如下所示:Can images are read from an iPhone programmatically using CreateFile in Windows?

from win32com.shell import shell

edit_path = r'Computer\My iPhone\Internal Storage\DCIM\828RTETC\IMG_2343.JPG'
parse_path = # How to convert edit_path to a SIGDN_DESKTOPABSOLUTEPARSING path?
i = shell.SHCreateItemFromParsingName(parse_path, None, shell.IID_IShellItem)
Run Code Online (Sandbox Code Playgroud)

最终目标是通过 IShellFolder 接口之类的东西迭代 DCIM“文件夹”,并将最近的照片复制到本地磁盘。我不想为解析名称打开 FileOpenDialog。但在此之前,我认为为其中一个文件创建一个 ShellItem 将是一个很好的测试。

python windows iphone winapi

5
推荐指数
1
解决办法
2160
查看次数

从Chrome 53开始,如何添加文本,就像调度了受信任的textInput事件一样?

从Chrome 53开始,不受信任的事件不再调用默认操作。https://developer.mozilla.org/zh-CN/docs/Web/API/Event/isTrusted

在Chrome 53之前,此JavaScript会添加一个interrobang?。

var e = document.createEvent('TextEvent');
e.initTextEvent('textInput',
                true,
                true,
                null,
                String.fromCharCode( 8253 ));
document.activeElement.dispatchEvent(e);
Run Code Online (Sandbox Code Playgroud)

在Chrome 53中,看看会发生什么:https//jsfiddle.net/dblume/2nfhrj1j/10/

由于使用createEvent()进行的事件是不受信任的事件,因此不会像在Chrome 52及之前的版本中那样由activeElement处理其数据。

从Chrome 53开始,我的Chrome扩展程序停止运行,因为它试图调度此类textInput事件。现在应该怎么办?

javascript google-chrome google-chrome-extension

2
推荐指数
1
解决办法
558
查看次数