Skip to content
Advertisement

Retrieving error while accessing files from the folders

I have the following code I need to files from the folder to be read by opencv.

JavaScript

I am retrieving the below error.

JavaScript

Help is highly appreciated. Thanks

Advertisement

Answer

You’re iterating over a string, so it will only get the first character. You need to list the contents of the directory. Use os.listdir like this.

JavaScript
User contributions licensed under: CC BY-SA
3 People found this is helpful
Advertisement