Question regarding file types

CircuitPython on hardware including Adafruit's boards, and CircuitPython libraries using Blinka on host computers.

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
Draculen
 
Posts: 72
Joined: Mon Jan 24, 2022 11:14 pm

Question regarding file types

Post by Draculen »

Can a .py script/file call a function that's on a .mpy file? Or because one is machine code (mpy) and one is not does that make certain functions not callable?

Example : if a callback is within an .mpy file and you try to call that function from a fellow script that is .py, does that make the function uncallable?

Just trying to find out why I'm getting this TypeError: 'AnimationSequence' is not a callable object

User avatar
dastels
 
Posts: 15658
Joined: Tue Oct 20, 2015 3:22 pm

Re: Question regarding file types

Post by dastels »

MPY files are just python code that's been precompiled to bytecode to save time and memory when loaded. PY files get compiled to bytecode when they get imported/loaded. So whether things are PY or MPY doesn't matter functionally.

AnimationSequence looks like a class name. Can you post your code and REPL output of the error trace?

Dave

Locked
Please be positive and constructive with your questions and comments.

Return to “Adafruit CircuitPython”