Greetings. Apologies in advance, I have some C programming background but I am a complete newbie to python. I am trying to do something simple - I’m trying to organize my project in to separate files much like I usually do with my C based projects. But for whatever reason, I cannot get the “import” functionality to work for a file I’ve created. I suspect that it has something to do with my file location or something simple I am missing in a file header, etc. I have a basic file named test.py with a simple function in it (note that the excerpt below is literally all I have in the file).
def testFunction: print("test")
In the same directory, I have another simple file named test_main:
import sensor, image, time, test sensor.reset() sensor.set_pixformat(sensor.RGB565) sensor.set_framesize(sensor.QVGA) sensor.skip_frames(time = 2000) clock = time.clock() while(True): clock.tick() img = sensor.snapshot() print(clock.fps())
When I try to run test_main, I get an ImportError: No module named ‘test’.
Both files are in the same directory. Originally they were not in the OpenMV folder in “mydocuments”, but I tried relocating them there with no success. So what am I missing? Has to be something simple/stupid. My understanding is that per ~feb of this year, the openmv ide supported importing like this - am I mistaken?
Rapid feedback appreciated - thanks!