Skip to content

Instantly share code, notes, and snippets.

@mygeekdaddy
Created April 8, 2014 17:44
Show Gist options
  • Save mygeekdaddy/10161740 to your computer and use it in GitHub Desktop.
Save mygeekdaddy/10161740 to your computer and use it in GitHub Desktop.
clipboard_check
#Convert clipboard to uppercase/lowercase
import clipboard
text = clipboard.get()
if text == '':
print 'No text in clipboard'
else:
uppercase = text.upper()
if uppercase != text:
new_clip = uppercase
else:
#already uppercase, convert to lowercase
new_clip = text.lower()
clipboard.set(new_clip)
print new_clip
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment