Nov-22-2018, 03:47 AM
I've been searching and still cannot find a solution to this issue. Under Windows 10, using Python 3.7, I'm passing a comma separated argument to the script, which then splits the string, and prints each file name. (Yes, the files need to be passed as one argument). But it doesn't work when spaces are in the path (See output below). How can I handle paths with spaces in the names?
jpgfiles = sys.argv[1] for jpgfile in jpgfiles.split(','): print ("Processing %s " % jpgfile)
Output:C:\Users\bernie\CentOS Share>myscript.py C:\Users\bernie\CentOS Share\DSC_1441.jpg,C:\Users\bernie\CentOS Share\DSC_1443.jpg
Processing C:\Users\bernie\CentOS