Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8567397
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T17:52:30+00:00 2026-06-11T17:52:30+00:00

Question1: I tried to make an script to speak with Pidgins DBus. My script

  • 0

Question1:

I tried to make an script to speak with Pidgins DBus. My script is something like this now:

#!/usr/bin/env python

import dbus, gobject
from dbus.mainloop.glib import DBusGMainLoop

class DBus_Answer():
    def __init__(self, text):
        dbus.mainloop.glib.DBusGMainLoop(set_as_default=True)
        bus = dbus.SessionBus()
        self.answer = text

        bus.add_signal_receiver(self.my_func,
                                dbus_interface="im.pidgin.purple.PurpleInterface",
                                signal_name="ReceivedImMsg")
        loop = gobject.MainLoop()
        loop.run()

    def my_func(self, account, sender, message, conversation, flags):
        print sender, "said:", message
        bus = dbus.SessionBus()
        obj = bus.get_object("im.pidgin.purple.PurpleService", "/im/pidgin/purple/PurpleObject")
        purple = dbus.Interface(obj, "im.pidgin.purple.PurpleInterface")
        purple.PurpleConvImSend(purple.PurpleConvIm(conversation), self.answer)

run = DBus_Answer("My message!")

This works fine. but my original program is using PyQt4 and I want to use QDBus to achieve this point. I searched a lot but I didn’t find any useful documentation about this topic.

Question2:
I read somewhere that python 3 does not support DBus, is it true? what would it use instead of that?

Thank you all.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T17:52:31+00:00Added an answer on June 11, 2026 at 5:52 pm

    I searched more and find some solutions. now my code is like this and work great ;-):

    #!/usr/bin/env python
    
    import sys
    import dbus
    from PyQt4.QtGui import QApplication
    from dbus.mainloop.qt import DBusQtMainLoop
    
    class DBus_Answer():
        def __init__(self, text):
            self.answer = text
            bus_loop = DBusQtMainLoop(set_as_default=True)
            self.bus = dbus.SessionBus()
            self.bus.add_signal_receiver(self.my_func,
                                         dbus_interface="im.pidgin.purple.PurpleInterface",
                                         signal_name="ReceivedImMsg")
    
        def my_func(self, account, sender, message, conversation, flags):
            obj = self.bus.get_object("im.pidgin.purple.PurpleService", "/im/pidgin/purple/PurpleObject")
            purple = dbus.Interface(obj, "im.pidgin.purple.PurpleInterface")
            purple.PurpleConvImSend(purple.PurpleConvIm(conversation), self.answer)
    
    app = QApplication(sys.argv)
    run = DBus_Answer("Slam")
    app.exec_()
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This is a long question. I've tried to make it more concise but I
I have written (tried to) this small bash script for searching through a range
So, I'm trying to make myself a Python script which goes through the selected
I'm trying to make an easy script in Python which takes a number and
I'm complete new to PHP. I tried to make a simple calculation script. The
Ok, so I tried to make this page with an addEventListener function, to address
Forgive me if this is a tried question, but I'm having a little difficulty
I have tried this question on the site of Titanium and several tweets to
this question is an extension of the question here i tried to extend Dane's
I have read numerous people with this question and have tried numerous strategies. However,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.