Skip to content

Instantly share code, notes, and snippets.

@GIJack
Last active August 30, 2021 19:17
Show Gist options
  • Save GIJack/2db2803f8c8933479bb6bd8439c60d99 to your computer and use it in GitHub Desktop.
Save GIJack/2db2803f8c8933479bb6bd8439c60d99 to your computer and use it in GitHub Desktop.
Python Utility Functions
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