Here's the fast tip for today:
1. See the dir where you are
2. see the files jpg that are in there
>>> import os
>>> import glob
>>> directory = os.getcwd()
>>> files = glob.glob("{}/*.jpg".format(directory))
For python 3.6 you have this new way to format strings
>>> files = glob.glob(f"{directory}/*.jpg") # python 3.6 ...
# You have a list of jpg files with full path
# To show them in the console
>>> for f in files:
>>> print(f)
1. See the dir where you are
2. see the files jpg that are in there
>>> import os
>>> import glob
>>> directory = os.getcwd()
>>> files = glob.glob("{}/*.jpg".format(directory))
For python 3.6 you have this new way to format strings
>>> files = glob.glob(f"{directory}/*.jpg") # python 3.6 ...
# You have a list of jpg files with full path
# To show them in the console
>>> for f in files:
>>> print(f)
Comments
Post a Comment