Last active
August 15, 2017 10:43
-
-
Save visitbethel/87b1d640159f62b5bb6fd5dd77d61e63 to your computer and use it in GitHub Desktop.
Python Cheat Sheet
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
# 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