Recent Notes

Displaying keyword search results 1 - 3
Created by jk34 on April 19, 2011 15:42:24    Last update: April 19, 2011 15:42:24
Check the __name__ variable to see if the Python module was invoked from the command line. The line prints when the Python script is called from the command line, but doesn't print when it is imported by another Python module with import MyModule . if __name__ == '__main__': print 'Invoked f...
Created by Dr. Xi on January 04, 2010 05:04:10    Last update: January 07, 2010 15:59:25
This is the error: >>> import urllib2 >>> f = urllib2.urlopen('htt... Reason: SSL is not supported in Python installation. >>> import httplib >>> hasattr(httplib, 'HTTPS'... Solution: recompile Python with SSL on Steps: Download and install OpenSSL , if you don't have it already. Download Python source and rebuild Python (the usual steps of configure, make and make install). Python's configure script should be able to pick up your existing SSL libraries automatically and build a shared library _ssl.so. Some web sites suggest editing the file Modules/setup.dist , uncomment the lines starting with _ssl , and making changes to the SSL path. This would link the SSL library statically to Python. # Socket module helper for socket(2) #_socket s...
Created by Dr. Xi on December 14, 2008 19:09:19    Last update: December 14, 2008 19:09:19
My mod_python app failed to extract Python eggs with this error: [Sun Dec 14 09:40:03 2008] [error] [client 127.0... The error message suggested to set the PYTHON_EGG_CACHE environment variable. While this may help solve the problem, there's no reason why the Python egg can't be installed expanded: easy_install -Z MySQL-python-1.2.2.tar.gz