gpt4 book ai didi

python - 将 dbus.String 转换为普通字符串

转载 作者:太空宇宙 更新时间:2023-11-04 07:48:00 25 4
gpt4 key购买 nike

我正在使用 dbus 从 Songbird Media Player 获取当前正在播放的歌曲,元数据也来自 dbus 对象。

出错的那一行是:-

audio_file = MP3(current_playing_track['location'], ID3=ID3)

错误是:-

 Traceback (most recent call last):
File "./last.py", line 42, in <module>
audio_file = MP3(current_playing_track['location'], ID3=ID3)
File "/usr/lib/python2.6/dist-packages/mutagen/__init__.py", line 73, in __init__
self.load(filename, *args, **kwargs)
File "/usr/lib/python2.6/dist-packages/mutagen/id3.py", line 1949, in load
try: self.tags = ID3(filename, **kwargs)
File "/usr/lib/python2.6/dist-packages/mutagen/id3.py", line 74, in __init__
super(ID3, self).__init__(*args, **kwargs)
File "/usr/lib/python2.6/dist-packages/mutagen/_util.py", line 103, in __init__
super(DictProxy, self).__init__(*args, **kwargs)
File "/usr/lib/python2.6/dist-packages/mutagen/__init__.py", line 37, in __init__
self.load(*args, **kwargs)
File "/usr/lib/python2.6/dist-packages/mutagen/id3.py", line 109, in load
self.__fileobj = file(filename, 'rb')
IOError: [Errno 2] No such file or directory: dbus.String(u'file:///media/Misc/Songbird%20Library/Puddle%20Of%20Mudd/Puddle%20Of%20Mudd%20-%20Unknown%20Album%20-%20Spin%20You%20Around.mp3', variant_level=1)

如何将文件位置转换为普通字符串

最佳答案

只需执行 str( your_dbus_string )

关于python - 将 dbus.String 转换为普通字符串,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2336127/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com