i trying copy contents of folder 1 directory another, final destination path outside of current working directory python searching though.
how find location without explicitly stating it?
here's have:
from myro import * import shutil import os import sys  def imagesync():     path1 = os.path.abspath("5-1-15 upload")     path2 = "c:\users\owner\pictures\plswork"      #path2 = sys.path.inset(0, 'c:\users\owner\pictures\plswork')      listing = os.listdir(path1)      image in listing:         shutil.copy2( os.path.join(path1, image), path2)   i guess problem similar to: importing files different folder in python. tried suggestions , received type error, commented out attempts didn't work.
thanks help!
the \u casue error:
in [2]: "\u"   file "<ipython-input-2-d8a2543b5007>", line 1     "\u"         ^ syntaxerror: (unicode error) 'unicodeescape' codec can't decode bytes in position 0-1: truncated \uxxxxxxxx escape   you should use raw string r or forward /'s in windows paths.
r"c:\users\owner\pictures\plswork"    or /:
"c:/users/owner/pictures/plswork"      the backslash () character used escape characters otherwise have special meaning, such newline, backslash itself, or quote character. string literals may optionally prefixed letter 'r' or 'r'; such strings called raw strings , use different rules interpreting backslash escape sequences. prefix of 'u' or 'u' makes string unicode string
Comments
Post a Comment