-2

If i try

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

i see only one "!".

So:

skype.Attach()

do not work.

This whole thematic is really grueling... Thank you Microsoft

4

2 回答 2

1

它适用于 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) 合作伙伴"
  • sudo apt-get 更新
  • sudo apt-get 安装Skype
  • Skype
  • sudo apt-get 安装 git
  • cd /home/myUser/
  • git 克隆https://github.com/Skype4Py/Skype4Py.git
  • sudo apt install python-pip
  • pip install -U setuptools
  • cd Skype4Py
  • 须藤 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 测试.py
  • 蟒蛇测试.py
于 2016-05-29T10:29:33.120 回答
1

首先,要使用 Skype4Py,您需要安装 Skype……一旦您完成设置并登录,请确保您有足够的信用额度,以防您想拨打收费电话或发送 SMS 消息。

我个人使用以下代码:

#! /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。

于 2016-05-21T17:04:00.597 回答