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 8167115
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T20:06:07+00:00 2026-06-06T20:06:07+00:00

I am using python-mpd to fetch current playing song artist and title. I am

  • 0

I am using python-mpd to fetch current playing song artist and title. I am able to do that successfully.

The problem is after I stop playing song using mpc stop and than try to fetch current playing song info it shows the last playing song info.

Get song info

>>> client.currentsong()['artist']
'Sean Paul feat. Alexis Jordan'

Now after I use mpc stop

>>> client.currentsong()['artist']
'Sean Paul feat. Alexis Jordan'
>>> 

So, my question is how do I make sure that mpd is currently playing or stopped?

What I need is that after mpc stop when I try to fetch song info it should show None or is there any method like if mpd_playing().

I tried to look at the python-mpd script but no luck.

  • 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-06T20:06:09+00:00Added an answer on June 6, 2026 at 8:06 pm
    >>> status = client.status()
    >>> status['state']
    'play'
    # or
    'pause'
    # or
    'stop'
    

    So here is the condition you need:

    if client.status()['state'] in ('play', 'pause'):
        #playing
    else:
        #stopped
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Using Python 2.6 I want to be able to convert numbers such as 00000,
Using Python I want to create a symbolic link pointing to a path that
When using Python is it possible that a dict can have a value that
hi so im using python and i'm trying to create a function that lets
using python 2.6.5 and python-ldap 2.3.10, I have the following problem: Under certain circumstances
Using Python v2.x, I have 3 variables that I want to ask the user
Using Python I want to be able to draw text at different angles using
Using Python 2.7 Situation: I have some piece of Python code (that the user
I am using Python and unfortunately my code needs to convert a string that
Using Python how do you reduce a list of lists by an ordered subset

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.