简体   繁体   English

带有Eclipse的Pywin32

[英]Pywin32 with Eclipse

With reference to the article regarding Pywin32 windows service ( Python win32 service ), I'm new to Python and I wanted to build a windows service in python. 参考有关Pywin32 Windows服务( Python win32服务 )的文章,我是Python的新手,我想在python中构建Windows服务。 The above given article was so helpful. 上述文章非常有帮助。 I'm using Python2.7 with Eclipse and installed pywin32-217.win32-py2.7. 我在Eclipse中使用Python2.7并安装了pywin32-217.win32-py2.7。 When I copied the code and executed it worked fine but all the imported modules appear underlined in red color saying Unresolved import (But it works). 当我复制代码并执行该代码时,它工作正常,但所有导入的模块均以红色加下划线显示,表示未解决的导入(但可以)。 Could anyone please be kind enough to help me with this and could you please tell me if eclipse supports code autocompletion for Pywin32. 任何人都可以友好地为我提供帮助,请告诉我eclipse是否支持Pywin32的代码自动完成功能。 If it is yes, please tell me how? 如果是,请告诉我如何?

On Windows: 在Windows上:

Make sure your [python root]/Lib/site-packages/win32 is in your System PYTHONPATH in your interpreter-setup (window -> preferences -> PyDev -> Interpreter - Python). 确保您的[python root]/Lib/site-packages/win32位于解释器设置的System PYTHONPATH中(窗口->首选项-> PyDev->解释器-Python)。 That should give you full auto-completion and let Eclipse recognize your win32 imports. 这将使您完全自动完成,并使Eclipse识别您的win32导入。

Hope this helps. 希望这可以帮助。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM