I’m using mod_wsgi and was wondering if it’s possible to over-write the print() command (since it’s useless).
Doing this doesn’t work:
print = myPrintFunction
Since it’s a syntax error. 🙁
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Print is not a function in Python 2.x, so this is not directly possible.
You can, however, override sys.stdout.
If you are on Python 3.0 in which print is now a function what you have would then work, assuming you have the right signature. Also see a related question in this site.