Stringmodifikation

L I V E Stammtisch ab 20:30 Uhr im Chat
  • Kleines Problem:
    Von mpd erhalte ich über 'mpc current' folgende beipielhafte Ausgabe:

    Code
    WOLL-IceCast: Kelly Clarkson - text="Heartbeat Song" song_spot="M" MediaBaseId="2077246" itunesTrackId="0" amgTrackId="-1" amgArtistId="0" TAID="34788" TPID="30271929" cartcutId="0881389001"

    Wie bekomme ich mit python-mitteln einen String der nur Interpret und Titel enthält - also:

    Code
    Kelly Clarkson - Heartbeat Song

    Mit shell-Kommandos kein Problem:

    Code
    mpc current |sed 's/.*: \(.*\)text="\([^"]*\).*/\1\2/'

    aber wie sieht sowas in python aus?


  • aber wie sieht sowas in python aus?

Jetzt mitmachen!

Du hast noch kein Benutzerkonto auf unserer Seite? Registriere dich kostenlos und nimm an unserer Community teil!