Home > Net >  how should i do it? how can i paste a given variable that resembles a path instead of the path itsel
how should i do it? how can i paste a given variable that resembles a path instead of the path itsel

Time:07-18

what am i doing wrong here? i want to use path as my path instead of copying my current folder path's.

import  glob  

path  = os.getcwd()
glob.glob(path*'.jpg') 

CodePudding user response:

I think what you are looking for is this:

import  glob  
path  = os.getcwd()
glob.glob(f'{path}/*.jpg')
  • Related