In Python ... how can I extract name and ext from the .txt file -


my file this.

  label0/index.jpeg 0    label1/index.jpeg 1 

my code

 def add_ext_name(cls, path, ext_name):      name, ext = os.path.splitext(os.path.basename(path))     added = os.path.join(os.path.dirname(path), name + ext_name + ext)     return added 

the error

 def basename(p):    """returns final component of pathname"""      p = os.fspath(p)      sep = _get_sep(p)      = p.rfind(sep) + 1  typeerror: expected str, bytes or os.pathlike object, not imageproperty 

where did make mistake ?


Comments

Popular posts from this blog

inversion of control - Autofac named registration constructor injection -

verilog - Systemverilog dynamic casting issues -

ios - Change Storyboard View using Seague -