This only works because the 'mysecretpassword' is 16 bytes. If it were a different (not dividable by 16) amount of bytes you'd get
"ValueError: AES key must be either 16, 24, or 32 bytes long"
To avoid this the key may be hashed:
self.key = hashlib.sha256(key.encode('utf-8')).digest()