Skip to content

Instantly share code, notes, and snippets.

@teionn
Last active March 9, 2019 17:40
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 teionn/e2bddc2601c36babb094b81e04144924 to your computer and use it in GitHub Desktop.
Save teionn/e2bddc2601c36babb094b81e04144924 to your computer and use it in GitHub Desktop.
import os
def split_path(path):
_dir, _file = os.path.split(path)
_name, _ext = os.path.splitext(_file)
return _dir.replace(os.sep,"/"), _name, _ext
split_path("C:/Program Files/Autodesk/Maya2018/bin/maya.exe")
# Result: ('C:/Program Files/Autodesk/Maya2018/bin', 'maya', '.exe') #
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment