Код: Выделить всё
import vlc
class CustomMediaPlayer(vlc.MediaPlayer):
def __init__(self, *args):
super().__init__(*args)
def custom_method(self):
print("EUREKA")
custom_mp = CustomMediaPlayer()
print(custom_mp)
custom_mp.custom_method()
Код: Выделить всё
AttributeError: 'MediaPlayer' object has no attribute 'custom_method'
Почему это происходит? Это потому, что vlc.MediaPlayer является классом _Ctype?
Подробнее здесь: https://stackoverflow.com/questions/789 ... -new-class