Monday, December 3, 2012

Spaces

Tons finished today but one thing is throwing it all off.

SPACES IN FILE NAMES

Python cannot seem to handle

Image.open('test 1.jpg')    -> IO File not found
Image.open('test1.jpg')     -> OK

I tried string replace methods that usually fix this ( '/ ' and '%20' ) but they're not working. Internet doesn't help either...

3 comments:

  1. That seems very odd to me... Python should handle spaces in filenames just fine.

    ReplyDelete
  2. I think you may need to use a backslash and then a space : '\ '

    ReplyDelete
  3. I tried that but it appears to be specific to BASH. I fixed it somewhat yesterday.

    ReplyDelete