-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

hannsworst
  • 291
  • 2
  • 11

2 Answers2

1

First of all, to use Skype4Py you need to have Skype installed... Once you're all set up and logged in, make sure you have credit in case you want to make chargeable calls or send SMS messages.

I personally use the following code:

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

When you first execute the code, you will get a popup in Skype: enter image description here

You will have to allow access! Only then will it allow you to connect to Skype when you make any connections with Skype via python.

T1M
  • 313
  • 1
  • 3
  • 14
1

It Works on Linux ! :-) ... Here is my Installation Guide:

Download Ubuntu: http://www.heise.de/download/264e2de9fdfd96e49a232ba76e279cd8-1463411395-22191449.html Create VMware with it

  • 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

Create a file 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
hannsworst
  • 291
  • 2
  • 11