如果我尝试
import Skype4Py
# Create an instance of the Skype class.
skype = Skype4Py.Skype()
print "!"
# Connect the Skype object to the Skype client.
skype.Attach()
print "!"
# Obtain some information from the client and print it out.
print 'Your full name:', skype.CurrentUser.FullName
print 'Your contacts:'
for user in skype.Friends:
print ' ', user.FullName
我只看到一个"!"。
所以:
skype.Attach()
不起作用。
这整个主题真的很累......谢谢微软
答案 0 :(得分:1)
首先,要使用Skype4Py,您需要安装Skype ... 一旦您完成所有设置并登录,请确保您有信用,以便您可以拨打收费电话或发送短信。
我个人使用以下代码:
#! /usr/bin/env python
# -*- coding: utf-8 -*-
import Skype4Py
import time
skype = Skype4Py.Skype()
# Attach to Skype client
skype.Attach()
print "___ SKYPE USER ___"
pro = Skype4Py.profile.Profile(skype)
print "User Name :", pro.FullName
print "Balance left:", pro.BalanceToText
您必须允许访问!只有这样,当您通过python与Skype建立任何连接时,它才允许您连接到Skype。
答案 1 :(得分:0)
适用于Linux! :-) ...这是我的安装指南:
下载Ubuntu:http://www.heise.de/download/264e2de9fdfd96e49a232ba76e279cd8-1463411395-22191449.html 用它创建VMware
创建文件test.py:
import Skype4Py
# Create an instance of the Skype class.
skype = Skype4Py.Skype()
# Connect the Skype object to the Skype client.
skype.Attach()
# Obtain some information from the client and print it out.
print 'Your full name:', skype.CurrentUser.FullName
print 'Your contacts:'
for user in skype.Friends:
print ' ', user.FullName