Skip to content

Instantly share code, notes, and snippets.

@Hellowlol
Last active September 1, 2015 19:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Hellowlol/20e98fef88979baf2590 to your computer and use it in GitHub Desktop.
Save Hellowlol/20e98fef88979baf2590 to your computer and use it in GitHub Desktop.
import os
try:
from pil import Image
print "imported from pil import Image #pillow"
except ImportError:
try:
import Image
print "imported image #PIL"
except ImportError:
print "no pil or pillow"
fp = r'/Applications/HTPCManager/userdata/images/b130c2be18a6e67879b74e7b67b3ab5b' # or some other path to images
if os.path.isfile(fp):
print "the damn fp is file"
im = Image.open(fp)
im.close()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment