我正在使用 32 位 python 在我的 win 8 机器上运行它,当我运行程序时,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'