-2
拆包字典當我試圖運行pychromecast庫的一個例子,我得到以下故障:「的SyntaxError」,而在Python
~/pychromecast $ python example.py
Traceback (most recent call last):
File "example.py", line 11, in <module>
import pychromecast.controllers.youtube as youtube
File "/home/pi/pychromecast/pychromecast/controllers/youtube.py", line 27
REQUEST_PARAMS_SET_PLAYLIST = {**BASE_REQUEST_PARAMS, **SET_PLAYLIST_METHOD}
^
SyntaxError: invalid syntax
我試圖在這兩個Python2和Python3運行此。這裏有什麼問題?
鏈接到出錯行:https://github.com/ur1katz/pychromecast/ blob/master/pychromecast/controllers/youtube.py#L27 – Irfan
這意味着該庫僅支持現代Python。 '{** BASE_REQUEST_PARAMS,** SET_PLAYLIST_METHOD}'適用於Python 3.5及更高版本。 – vaultah
謝謝!這解釋了它,我有Python 3.4.5 – Irfan