Skip to content

Instantly share code, notes, and snippets.

@sankars
Created July 23, 2014 16:00
Show Gist options
  • Save sankars/e692a4d74b044dd7f4b6 to your computer and use it in GitHub Desktop.
Save sankars/e692a4d74b044dd7f4b6 to your computer and use it in GitHub Desktop.
File manipulation in pyhton
import os
def main():
print os.getcwd()
print os.path.abspath('..')
print os.path.basename(os.getcwd())
print os.path.dirname(os.path.realpath(__file__))
if __name__ == '__main__':
main()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment