Top "Python-2.7" questions

Python 2.7 is the last major version in the 2.x series, and is no longer maintained since January 1st 2020.

Python handling socket.error: [Errno 104] Connection reset by peer

When using Python 2.7 with urllib2 to retrieve data from an API, I get the error [Errno 104] Connection reset by peer. …

python ubuntu python-2.7 urllib2
Python threading.timer - repeat function every 'n' seconds

I want to fire off a function every 0.5 seconds and be able to start and stop and reset the timer. …

python python-3.x python-2.7
How to pass dictionary items as function arguments in python?

My code 1st file: data = {'school':'DAV', 'standard': '7', 'name': 'abc', 'city': 'delhi'} my_function(*data) 2nd file: my_…

python function python-2.7 dictionary
Python: How to get stdout after running os.system?

I want to get the stdout in a variable after running the os.system call. Lets take this line as …

python python-2.7 stdout stderr os.system
error: (-215) !empty() in function detectMultiScale

I'm trying to learn cv2 in python 2.7, but when I run my code, in the specific part of it: face_…

python python-2.7 opencv image-recognition
Split string using a newline delimiter with Python

I need to delimit the string which has new line in it. How would I achieve it? Please refer below …

python string python-2.7
Strip spaces/tabs/newlines - python

I am trying to remove all spaces/tabs/newlines in python 2.7 on Linux. I wrote this, that should do the …

python string python-2.7 strip
What is a good way to handle exceptions when trying to read a file in python?

I want to read a .csv file in python. I don't know if the file exists. My current solution is …

python python-2.7 exception file-io
(13: Permission denied) while connecting to upstream:[nginx]

I am working with configuring Django project with Nginx and Gunicorn. While I am accessing my port gunicorn mysite.wsgi:…

django python-2.7 nginx gunicorn
How can I read pdf in python?

How can I read pdf in python? I know one way of converting it to text, but I want to …

python python-2.7 pdf text-extraction