Skip to content

Instantly share code, notes, and snippets.

@raganmd
Last active May 6, 2019 06:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save raganmd/e3bf539788f6ddc28bc84778ea9514f2 to your computer and use it in GitHub Desktop.
Save raganmd/e3bf539788f6ddc28bc84778ea9514f2 to your computer and use it in GitHub Desktop.
def my_pars_to_dict(p_name):
# create empty par_dict with input name as the preset_name value
par_dict = {
"preset_name" : p_name,
"preset_vals" : {
"Blacklevel" : op('base1').par.Blacklevel.val,
"Contrast" : op('base1').par.Contrast.val,
"Opacity" : op('base1').par.Opacity.val
}
}
return par_dict
# example use
p_name = "Preset001"
presets = my_pars_to_dict(p_name)
print(presets)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment