Skype4Py 还活着吗?

Is Skype4Py alive?

如果我尝试

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

不工作。

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

首先,要使用 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 中看到一个弹出窗口:

您必须允许访问!只有这样,当您通过 python.

与 Skype 建立任何连接时,它才会允许您连接到 Skype

适用于 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 更新
  • sudo apt-get 安装 skype
  • Skype
  • sudo apt-get 安装git
  • cd /home/myUser/
  • git 克隆 https://github.com/Skype4Py/Skype4Py.git
  • sudo apt 安装python-pip
  • pip install -U setuptools
  • cd Skype4Py
  • sudo python setup.py 安装
  • 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