python在window上使用py2applet --make-setup Yanghui_triangle.py时,会出现提示缺少fcntl.py文件,影响python使用。解决办法:可以该文件代码放到python安装路径下的lib包内,即可。
fcntl.py 代码如下:
#Generated by h2py from /usr/include/fcntl.h #Included from sys/types.h #Included from sys/cdefs.h def _P(protos): return protos def _STRING(x): return #x def _XSTRING(x): return _STRING(x) def _P(protos): return () def _STRING(x): return "x" def _RCSID(s1001120394952607): return _IDSTRING(rcsid,s) def _RCSID_SOURCE(s): return _IDSTRING(rcsid_source,s) def _COPYRIGHT(s): return _IDSTRING(copyright,s) #Inculde from machine/ansi.h _BSD_PTRDIFF_T_ = int _BSD_SSIZE_T_ = int _BSD_TIME_T_ = float _BSD_CT_RUNE_T_ = int _BSD_PID_T_ = int _BSD_CLK_TCK_ = 128 _BSD_CLOCK_PER_SEC_ = 128