Skype4Py不会连接到windows上的Skype

2024-10-01 17:23:38 发布

您现在位置:Python中文网/ 问答频道 /正文

我正在用一个32位的python在我的win8机器上运行它,当我运行程序时,skype响应一条消息(见顶部栏):“另一个应用程序(python.exe)正在尝试访问Skype,但无法响应。请尝试重新启动应用程序“

代码:

import Skype4Py
import socket
import codecs
import sys
#setup
#sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
#server_address = ('127.0.0.1', 65205)
#print  'starting up on '+ str(server_address[1])
#sock.bind(server_address)
#sock.listen(1)
#enableling different languages 
UTF8Writer = codecs.getwriter('utf8')
sys.stdout = UTF8Writer(sys.stdout)
#skype setup
skype =Skype4Py.Skype()
availFriends = []
skype.Attach()

#block mode
def mstat(Message,status):
    if(status == Skype4Py.cmsReceived ):#act on receive
        Message.MarkAsSeen()
        print Message.Body
        skype.SendMessage(Message.Sender.Handle,"Did you send me :\n"+Message.Body+"\n good , Stop messaging me!")

def GetAllOnlinePeople():
    availFriends = []
    badStatusCodes = ['UNKNOWN', 'OFFLINE', 'DND', 'LOGGEDOUT']
    for f in skype.Friends:
        if not f.OnlineStatus in badStatusCodes:
            availFriends.append(f)


###########################################3
#connection, client_address = sock.accept()
#print  'connection from'+ str(client_address[0])
# Receive the data in small chunks and retransmit it    
#data = connection.recv(128)
#if data== 'bmode':
skype.OnMessageStatus = mstat
while(1==1):
    i='p'

Tags: inimportmessagedataifserveraddresssys
1条回答
网友
1楼 · 发布于 2024-10-01 17:23:38

不确定这是否有帮助,但最近我在尝试从Windows PowerShell启动sevabot时看到了来自skype的类似消息。 请看下面的截图: enter image description here

当我从WindowsCMD启动它时,这个警报就消失了。 我的Skype版本是7.16.85.102,Skype4Py版本是1.0.35。在

希望有帮助。在

相关问题 更多 >

    热门问题