Skip to content

Instantly share code, notes, and snippets.

@michaelhelmick
Created June 7, 2012 19:18
Show Gist options
  • Save michaelhelmick/2890975 to your computer and use it in GitHub Desktop.
Save michaelhelmick/2890975 to your computer and use it in GitHub Desktop.
params = {
'message': 'Hi dude.',
'source': open('filepath.jpg', 'rb')
}
files = {}
for k, v in params.items():
if isinstance(v, file):
files[k] = v
params.pop(k)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment