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
265
questions
0
votes
0
answers
20
views
AttributeError when running unittest with coverage in Python 2.7 on WSL
I'm encountering an error while attempting to run unit tests with unittest and coverage in Python 2.7 on a Windows 11 system using WSL (Windows Subsystem for Linux). The error message suggests an ...
0
votes
0
answers
60
views
How to move effector near a target object?
I am using Python 2.7 with naoqi to make the robot grab an object with both hands (either from the bottom or from two sides).
As a first step I want to move an effector to one side of a perceived ...
-1
votes
0
answers
25
views
Getting microphone recording from Pepper robot: no output
I'm trying to get a recording from Pepper's microphones over a period of time.
What I'm trying is basically this:
audio_service = session.service("ALAudioDevice")
audio_service....
2
votes
1
answer
72
views
Is there a way to mock .strip() for unit testing in Python 2.7's unittest module?
I am using Python 2.7 for a coding project. I'd love to switch to Python 3, but unfortunately I'm writing scripts for a program that only has a python package in 2.7 and even if it had one in 3 our ...
0
votes
1
answer
27
views
boto 2.49.0 unable to load ECS Fargate task role credentials from instance metadata
I am working on getting a legacy application up and running. It is using Python 2.7, I have managed to get it Dockerized and deployed to ECS using Fargate.
However the legacy code is using boto 2.49.0 ...
0
votes
0
answers
35
views
Unable install python-ldap in python 2.7.9 on windows 11
I cannot install the required package because it needs Visual Studio C++ 9.0, which is no longer supported. Unfortunately, I can't upgrade my Python version because I need it for Odoo 8 development. ...
5
votes
3
answers
90
views
Why is format() throwing ValueError: Unknown format code 'f' for object of type 'str' when I'm not inputting a string?
I am using Python 2.7. (Switching to Python 3 for this particular code is not an option, please don't suggest it.) I am writing unit tests for some code.
Here is the relevant piece of code:
class ...
0
votes
1
answer
40
views
Generate Python 2.7 dependency tree for offline installation [duplicate]
I need to install the dateutil Python library to run a script at work.
The problem is that our machines do not have internet access so we cannot use pip2.7 to install the dependencies. What we can do ...
0
votes
0
answers
25
views
CalledProcessError throwing when executing HDFS cp command throw subprocess.check_output
I encountered a CalledProcessError when I ran the HDFS cp command using the subprocess.check_output function. Below is a sample of my program.
>>import subprocess
>>command = "hdfs ...
0
votes
0
answers
32
views
Is there a way to make RS232 communication with fluke8846a faster for measurement?
I’m using Fluke 8846A for measuring current in a setup where the current range is set to 10A. I’m using MEASure method to read value from Fluke 8846a using RS232 communication at baud rate of 115200 ...
1
vote
2
answers
51
views
Python Pandas data frame column split based on previous unique columns combination [duplicate]
I have a data frame like below:
TAG TAG_NAME METRIC METRIC_NAME CAPTURE_DATE MB
DB PRO SPACE A 2024-03-01 3
DB PRO SPACE B 2024-03-01 4
DB ...
0
votes
2
answers
67
views
List of lists (double [[) in Python
This is a really basic thing but after reading the documentation I am still not able to do. I just want to create a list of 9 sublists as follows
[[0, 0.05, 0.1, ..., 25],[0, 0.05, 0.1, ..., 25],[0, 0....
-1
votes
2
answers
65
views
can't find the page URL
I got the same error while writing code.
I started making this project using a video tutorial on YouTube. I think the problem is in the URLConf but I can’t find this problem myself.
Essentially the ...
0
votes
1
answer
20
views
Dict comprehension over multiple dicts with missing keys
I have a piece of legacy python2 code that looks like the following
# dict1 and dict2 are inputs. dict2 is where the value is a 4-tuple
return {
key: [
NamedTuple1(val1, ...
0
votes
0
answers
20
views
Error Building 'pycapnp' for AppScale on Ubuntu 18.04 with Python 2.7
As a Java Developer transitioning into the Python ecosystem, I've noticed a difference in how dependencies are handled between the two languages. In Java, project dependencies remain intact and the ...