Skip to content

Instantly share code, notes, and snippets.

@jinqian
Last active December 20, 2015 04:09
Show Gist options
  • Select an option

  • Save jinqian/6069274 to your computer and use it in GitHub Desktop.

Select an option

Save jinqian/6069274 to your computer and use it in GitHub Desktop.
fullpath = "/Users/bonbon/image/cover.jpg"
dirpath, file = os.path.split(fullpath)
name = os.path.splitext(file)[0]
print file # "cover.jpg"
print name # "cover"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment