Skip to content

Instantly share code, notes, and snippets.

@ferristseng
Created August 31, 2013 04:43
Show Gist options
  • Select an option

  • Save ferristseng/6396255 to your computer and use it in GitHub Desktop.

Select an option

Save ferristseng/6396255 to your computer and use it in GitHub Desktop.
transform a dictionary of url parameters into a string
def parse_options(opts):
if opts:
return '?%s' % '&'.join(['%s=%s' % (k, v) for (k, v) in opts.iteritems()])
return ''
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment