#πŸ”’ "Loop File Reading" Help

15 messages Β· Page 1 of 1 (latest)

blazing apex
#

so I'm currently have a problem with this work at the moment

the context is that I need to run reading loop on file, the file in question is thousand of screenshot for the purpose of scanning and identifying the object inside it using the 3rd block of code, the red box for a reference on how I think it's suppose to be a full output.

Any advice and recommendation on what code I should use for it?

restive sentinelBOT
#

@blazing apex

Python help channel opened

Remember to:

  • Ask your Python question, not if you can ask or if there's an expert who can help.
  • Show a code sample as text (rather than a screenshot) and the error message, if you've got one.
  • Explain what you expect to happen and what actually happens.

:warning: Do not pip install anything that isn't related to your question, especially if asked to over DMs.

gaunt vessel
blazing apex
#

so, uh, I have this thousand of screenshot in the folder, right? so, I need to scan it but I can't do it manually because there is too many of them, so I need a code that will read every file in the folder automatically

hope that's making enough sense for you

gaunt vessel
#

are they all in the same folder?

blazing apex
#

yep, single folder

gaunt vessel
#

you can use pathlib and glob

#
from pathlib import Path


path = Path("C:/path/to/images")

for img in path.glob('*.jpg'):
    ...
#

just change the path here to whatever your path is

blazing apex
#

try it now, I don't think it's did anything

gaunt vessel
#

you can try printing the img_file to see if it's finding them

blazing apex
#

ok, I'll try figuring out what is my file logic then

restive sentinelBOT
#
Python help channel closed for inactivity

This help channel has been closed. Feel free to create a new post in #1035199133436354600. To maximize your chances of getting a response, check out this guide on asking good questions.