For questions about Python programming that are specific to version 2.x of the language.
The csv module in Python doesn't work properly when there's UTF-8/Unicode involved. I have found, in the Python documentation …
python csv unicode utf-8 python-2.xI have a large piece of Python 2 only code. It want to check for Python 3 at the beginning, and exit …
python python-3.x python-2.xI thought I could use named parameters after variable-length positional parameters in a function call in Python 2, but I get …
python variadic-functions python-2.x named-parameters default-parametersI've tried from mock import Mock import __builtin__ __builtin__.print = Mock() But that raises a syntax error. I've also tried …
python unit-testing mocking python-2.xI'm trying to resize an image to 500x500px but got this error: File "C:\Python27\lib\site-packages\PIL\Image.…
python python-2.7 python-2.x image-resizingI have some legacy code with a legacy function that takes a filename as an argument and processes the file …
python python-2.x with-statement contextmanagerI have the following code inside a function: stored_blocks = {} def replace_blocks(m): block = m.group(0) block_hash = sha1(…
python closures scope python-2.xI would like to set a user prompt with the following question: save_flag is not set to 1; data will …
python python-3.x input python-2.x raw-inputAll I want is for bool(myInstance) to return False (and for myInstance to evaluate to False when in a …
python class casting boolean python-2.xI would like to change the chars of a string from lowercase to uppercase. My code is below, the output …
python string python-2.x uppercase lowercase