[英]writing python script on windows
I am new to python scripts . 我是python脚本的新手。
I have few repetative testing tasks such logging to various IM's 我几乎没有重复的测试任务,例如登录到各种IM
ex (OCS,different public messengers) etc . 例如(OCS,不同的公共通讯程序)等。
Is it possible to automate these tasks using python . 是否可以使用python自动执行这些任务。
If so from where do I start with ? 如果是这样,我从哪里开始?
Working on windows 2003 server . 在Windows 2003 Server上工作。
I know the basics of python. 我知道python的基础知识。 want to enhance the skills . 想提高技能。
Thanks, Tazim 谢谢,塔济姆
Not quite a duplicate question, but the answers to " How can we use ms office communicator client exposed APIs in python, is that possible ? " should prove valuable. 这并不是一个重复的问题,但是“ 如何才能在python中使用ms office communicator客户端公开的API,有可能吗? ”的答案应该很有价值。
If you are new to Python, you'll want to check out the Python Tutorial . 如果您不熟悉Python,则需要查看Python教程 。
You may also wish to consider something a bit more Windows-oriented like VBScript or PowerShell, however. 但是,您可能还希望考虑一些面向Windows的东西,例如VBScript或PowerShell。
For OCS, you should be able to use COM scripting to do most but not all[1] things. 对于OCS,您应该能够使用COM脚本执行大部分但不是全部[1]的事情。 The code should look a bit like this: 该代码应如下所示:
import win32com.client
def get_contact(signin_uri, communicator):
c = communicator.GetContact(signin_uri, communicator.MyServiceId)
return c
comm = win32com.client.Dispatch('Communicator.UIAutomation')
contact = get_contact("jaya@contoso.com", comm)
You should be able to translate the documentation from the API fairly easily, especially if you focus on the JScript examples. 您应该能够相当容易地从API转换文档,特别是如果您关注JScript示例。
For MSN/Live Messenger, the excellent twisted library contains an rudimentary implementation of a multiprotocol IM client (and server). 对于MSN / Live Messenger,出色的扭曲库包含多协议IM客户端(和服务器)的基本实现 。 To get started, check out some code samples . 首先,请查看一些代码示例 。
[1] From the documentation: [1]从文档中:
For reasons of security, not all methods or properties can be called using JavaScript or another scripting language. 出于安全性考虑,并非所有方法或属性都可以使用JavaScript或其他脚本语言来调用。 Such restrictions are documented in Office Communicator Automation API Reference . Office Communicator Automation API参考中记录了此类限制。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.