小编mac*_*ach的帖子

如何在pycharm中提交部分文件(帅哥)git

我是一个沉重的Eclipse PyDev + EGit用户,并希望切换到PyCharm.在Eclipse中,我可以选择仅向git索引添加文件的某些字母/行,与git add -p从终端使用相同.我发现通过GUI更快地完成它,我一直在寻找PyCharm中的相同功能.它存在吗?谢谢

git pycharm

25
推荐指数
2
解决办法
6177
查看次数

如何使用 python win32com 或 comtypes 中的 COM 访问 IRTDServer?

环境

Windows 10 + python 3.6.3 64 位(也尝试过 32 位)。我是一名 Python 开发人员,(几乎)第一次尝试使用 COM,但遇到了这个巨大的障碍。

问题

当我尝试使用在 dll 中实现的 IRTDServer(不是我编写的)时,通过 或 ,我遇到了各种win32com错误comtypes。使用结果win32com变得更加困难。我为下面的两个库提供了一个示例单元测试。

从 Excel 2016 访问服务器按预期工作;这将返回预期值:

=RTD("foo.bar", , "STAT1", "METRIC1")
Run Code Online (Sandbox Code Playgroud)

使用 win32com 库的代码

这是一个简单的测试用例,应该连接到服务器,但没有连接到服务器。(这只是一个版本,因为我已经多次更改它来尝试调试问题。)

from unittest import TestCase

class COMtest(TestCase):
    def test_win32com(self):
        import win32com.client
        from win32com.server.util import wrap

        class RTDclient:
            # are these only required when implementing the server?
            _com_interfaces_ = ["IRTDUpdateEvent"]
            _public_methods_ = ["Disconnect", "UpdateNotify"]
            _public_attrs_ = ["HeartbeatInterval"]

            def __init__(self, *args, **kwargs):
                self._comObj = win32com.client.Dispatch(*args, …
Run Code Online (Sandbox Code Playgroud)

python com pywin32 comtypes win32com

3
推荐指数
1
解决办法
1万
查看次数

标签 统计

com ×1

comtypes ×1

git ×1

pycharm ×1

python ×1

pywin32 ×1

win32com ×1