python文件名是方向图.py 这个文件很容易被谷歌找到。 这个python脚本用于可视化android中WindowOrientationListener的行为。 但它是为linux编写的。 我想在windows中使用它。 但是有一个错误,我怎样才能使这个文件在windows中运行。在
Traceback (most recent call last):
File "G:\perftool\orientationplot\orientationplot.py", line 27, in <module>
import fcntl
ImportError: No module named fcntl
fcntl.fcntl(stream, fcntl.F_SETFL, os.O_NONBLOCK)
你绝对不能简单地为Windows重写这个程序。它大量使用} 是Linux上操作文件描述符的系统调用。在
fcntl
模块。如果您不知道,^{nosklo在this StackOverflow answer中写道:
^{bq}$不过,我想指出的是,通过一些研究,这可能是可能的。您需要弄清楚如何在Windows中设置流的文件描述符标志(即流的权限和open() system call指定的其他标志),并设置
os.O_NONBLOCK
。我在Winsock website上找到了更多信息:相关问题 更多 >
编程相关推荐