Issue
I want to create a variable that's value is the name of the folder that I am working in. I can use pwd to see the working directory but I cannot figure out if there is a way to save the pwd output as a variable or better yet make a variable with only the current folder not the entire directory.
Solution
Here is one method:
#!/usr/bin/env python2.7
import os
current_folder = os.getcwd().split(os.sep)[-1]
print(current_folder)
Answered By - Fake Code Monkey Rashid