Skip to main content

Questions tagged [python-2.7]

Python 2.7 is the last major version in the 2.x series, and is no longer maintained since January 1st 2020. Use the generic [python] tag on all Python questions. Do not add this tag simply to convey the version of Python you're using, unless the question concerns an issue specific to Python 2.7.

python-2.7
74 votes
3 answers
127k views

How to update the image of a Tkinter Label widget?

I would like to be able to swap out an image on a Tkinter label, but I'm not sure how to do it, except for replacing the widget itself. Currently, I can display an image like so: import Tkinter as ...
skeggse's user avatar
  • 6,273
13 votes
5 answers
7k views

What code can I use to check if script is running in IDLE?

Just as the title says. I want to write a script that behaves differently depending on whether it's running inside a console window or in IDLE. Is there an object that exists only when running in IDLE ...
KeJi's user avatar
  • 288
151 votes
2 answers
194k views

What is the Python 'buffer' type for?

There is a buffer type in Python, but how can I use it? In the Python documentation about buffer(), the description is: buffer(object[, offset[, size]]) The object argument must be an object that ...
satoru's user avatar
  • 32.8k
1 vote
1 answer
2k views

How much faster is Python 2.7's new IO library compared to earlier versions?

The Python 2.7 update note says: A new version of the io library, rewritten in C for performance. I've played with Python 2.7 a bit, but I don't see any performance gain: >>> from timeit ...
Wang Dingwei's user avatar
  • 4,759
1 vote
4 answers
12k views

PyScripter for Python 2.7

How to run PyScripter if you have Python 2.7 installed? There is a command line parameter for Pyscipter to tell it which pythonXX.dll to use, but I can't get this working.
Primoz's user avatar
  • 31
5 votes
1 answer
13k views

mod_python for python 2.7

I recently downloaded python 2.7 on my computer (x64) and I would like to install mod_python for it (I have apache 2.2), however, I can't find a mod_python release supporting python 2.7. Has ...
T0xicCode's user avatar
  • 4,825
17 votes
7 answers
41k views

Manipulating binary data in Python

I am opening up a binary file like so: file = open("test/test.x", 'rb') and reading in lines to a list. Each line looks a little like: '\xbe\x00\xc8d\xf8d\x08\xe4.\x07~\x03\x9e\x07\xbe\x03\xde\x07\...
Dominic Bou-Samra's user avatar
5 votes
1 answer
137 views

Output being printed in the same line, Py3k

In Python 2.x, I'd write... for i in range(5): print i, ...to get integers from 0 to 4 printed in the same row. How to do that in Python 3.x, since print is a function now?
Bane Bojanić's user avatar
24 votes
7 answers
45k views

How to set time limit on raw_input

in python, is there a way to, while waiting for a user input, count time so that after, say 30 seconds, the raw_input() function is automatically skipped?
calccrypto's user avatar
  • 8,873
1 vote
2 answers
2k views

How to see if there is one microphone active using python?

I want to see if there is a microphone active using Python. How can I do it? Thanks in advance!
aF.'s user avatar
  • 66.2k
26 votes
2 answers
1k views

Python -- what is NOT in 2.7 that IS in 3.1? So many things have been back-ported, what is NOT?

I've been following the saga of Python 3.x and have watched the 3.x features gradually getting back-ported to the 2.x line. Most of the libraries I use haven't been ported and some (e.g. Twisted) ...
StuFuller's user avatar
  • 261
4 votes
4 answers
4k views

Python: asynchronous tcp socketserver

I'm looking http://docs.python.org/library/socketserver.html to try and handle asynchronous requests with the socketserver in python. At the very bottom there is an example, but it doesn't make sense. ...
The.Anti.9's user avatar
  • 44.3k
1 vote
4 answers
7k views

How do you store raw bytes as text without losing information in python 2.x?

Suppose I have any data stored in bytes. For example: 0110001100010101100101110101101 How can I store it as printable text? The obvious way would be to convert every 0 to the character '0' and ...
Manuel Araoz's user avatar
  • 16.3k
26 votes
4 answers
39k views

Mixing files and loops [closed]

I'm writing a script that logs errors from another program and restarts the program where it left off when it encounters an error. For whatever reasons, the developers of this program didn't feel it ...
Allan Lavell's user avatar
2 votes
3 answers
6k views

How to deliver instance of object to instance of SocketServer.BaseRequestHandler?

This is problem. My primary work is : deliver "s" object to "handle" method in TestRequestHandler class. My first step was : deliver "s" object through "point" method to TestServer class, but here im ...
user avatar

15 30 50 per page