OpenMV IDE Python compatibility

When I open an example file, the code looks color coded with all the keywords, etc. but as soon as I save the file under a different name or I create my own file it simply behaves as a basic text editor. All the text is the same color, no auto indent after a for or if statement, no higlighting of any instrcutions such as import, print, etc.
I’m on Windows 10. Everything else works great. I tried it on MacOS, and the color coding works fine, but no auto-indent though. What am I missing?

Did you remove the .py from the file when you saved it?

No, all the files were saved by default as .py. Note that when I create a “new” file from scratch using the IDE, it always creates a file named “untitled_*.py” and includes always the following code:

# Untitled - By: alierdengiz - Sun Jun 13 2021

import sensor, image, time

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())

But once this is done, adding a simple for loop for instance, right after the last line in the while loop, gives this:

while(True):
    clock.tick()
    img = sensor.snapshot()
for i in range(10):
print (i)

The IDE keeps the coloring scheme, but is totally unaware of the indentation history. Note that MacOS conserves the color scheme, but Window doesn’t even keep that.

Am I missing a plug in somewhere? There is nothing in the “options” menu item to select any programming language rules, e.g. python, c++…

Regards

Ali

Go to tools → options → Text editor → behavior → typing → and uncheck automatic indentation. Also, choose never for both combo boxes there.

A user wanted an issue fixed that apparently caused previous behavior to break. Things actually work correctly when this option is unchecked now.

I will have this option fixed and hidden in the future.

Nope, doesn’t work for MacOs, nor for Windows 10. I’m assuming we are talking about v2,6,9 here. Is there a newer (or older) version?

Ali Erdengiz

ali.erdengiz@gmail.com

C[FR] +33 (0) 7 67 70 96 92
C[US] +1 (415) 939 3476

Sorry, I forgot to add that the color coding seems fixed, but not the indentation.