Created
July 18, 2018 08:31
-
-
Save h3nryza/111fca89c66b64b87696f61df66b73f4 to your computer and use it in GitHub Desktop.
Python check for training slash on a folder, add if missing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def trailingBackSlash(location): | |
if location[-1:] != "/" and "/" in location: | |
location = location + "/" | |
elif location[-1:] != "\\" "\\" in location: | |
location = location + "\\" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment