Skype4Py还活着吗?

时间:2016-05-16 11:59:33

标签: skype4py

如果我尝试

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()

不起作用。

这整个主题真的很累......谢谢微软

2 个答案:

答案 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

当您第一次执行代码时,您将在Skype中获得弹出窗口: enter image description here

您必须允许访问!只有这样,当您通过python与Skype建立任何连接时,它才允许您连接到Skype。

答案 1 :(得分:0)

适用于Linux! :-) ...这是我的安装指南:

下载Ubuntu:http://www.heise.de/download/264e2de9fdfd96e49a232ba76e279cd8-1463411395-22191449.html 用它创建VMware

  • sudo add-apt-repository" deb http://archive.canonical.com/ubuntu $(lsb_release -sc)partner"
  • sudo apt-get update
  • sudo apt-get install skype
  • 的Skype
  • sudo apt-get install git
  • cd / home / myUser /
  • git clone https://github.com/Skype4Py/Skype4Py.git
  • sudo apt install python-pip
  • pip install -U setuptools
  • cd Skype4Py
  • sudo python setup.py install
  • sudo apt-get install python-dbus
  • sudo apt-get virtualenv
  • virtualenv --system-site-packages dbus-venv
  • sudo apt-get install python-gobject

创建文件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
  • chmod 775 test.py
  • python test.py