Skip to content

Instantly share code, notes, and snippets.

@turgay
Created October 4, 2015 11:44
Show Gist options
  • Save turgay/ead6c73386612858301b to your computer and use it in GitHub Desktop.
Save turgay/ead6c73386612858301b to your computer and use it in GitHub Desktop.
Python override builtin input function
import __builtin__
def fake_input(prompt):
print prompt
return "trgy"
__builtin__.raw_input = fake_input
name = raw_input("Enter your name >")
print "Hello,"+name+"!"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment