Send Image in Skype Chat using Python

In this post, we will send an image to the Skype contact programmatically using Python. Before starting with the code, install the python module skpy. Go to any command line and enter the below command.

pip install skpy

You will have to enter the password of your Skype account in the Base64 encoded form. Learn to encode the string to Base64 using Python.

Python Code

from skpy import Skype
import base64
import traceback

username = "<Skype account Email>"
password = "<Base64 Encoded Skype Password>"

    # connect to Skype
    skype_connect = Skype(username, base64.b64decode(password.encode('utf-8')).decode('utf-8')) 
    chat = skype_connect.contacts["live:<Your Contact User id>"].chat
    filePath = "C:/Users/Pictures/images.png"
    name = "images.png"
    chat.sendFile(open(filePath, "rb"), name, image=True) # file upload
    print("An exception occurred")


Thank you All!!! Hope you find this useful.

Leave a Reply

Up ↑

%d bloggers like this: