Last active
August 30, 2021 19:17
-
-
Save GIJack/2db2803f8c8933479bb6bd8439c60d99 to your computer and use it in GitHub Desktop.
Python Utility Functions
This file contains 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 slugify(in_text): | |
'''return a slug. Remove spaces, and lowercase''' | |
out_text = in_text.strip() | |
out_text = out_text.lower() | |
out_text = out_text.replace(" ","") | |
return out_text | |
import sys | |
def os_supported(): | |
'''Check if current Operating System is supported. Edit supported_list as needed''' | |
supported_list = ['linux', 'win', 'freebsd', 'darwin'] | |
output = False | |
for item in supported_list: | |
if item in sys.platform: | |
output = True | |
break | |
return output |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment