Skip to content

Instantly share code, notes, and snippets.

@visitbethel
Last active August 15, 2017 10:43
Show Gist options
  • Save visitbethel/87b1d640159f62b5bb6fd5dd77d61e63 to your computer and use it in GitHub Desktop.
Save visitbethel/87b1d640159f62b5bb6fd5dd77d61e63 to your computer and use it in GitHub Desktop.
Python Cheat Sheet
# STRING operations
# trim string = strip()
gav=gavString.strip().split(':')
# create types
retValue = {}
retValue = []
# length
i = len(retValue)
# adding element to array
retValue.append("newvalue")
# loop over hash
for _level in comp.levels:
# if file exists
import os.path
if os.path.isfile('myfile')
# loading
_module = sys.modules["fdeploy.platform"]
# loading a 'Generator' class from the py file 'fdeploy/platform.py' and construct it with a 'constructor' string.
_class = getattr(_module, 'Generator')('constructor') #
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment