All Questions
Tagged with python-2.7 python
63,121
questions
-3
votes
0
answers
18
views
how can I compute the striking force of a football player using python [closed]
in a football match between England and Spain Julius Fueke needs a decisive goal, write a Python program that can compute the striking force of each of the players
i tried using the import numpy but ...
0
votes
1
answer
62
views
how to conver new key into old in python3 ndb
Here my code
new_key= ndb.Key(urlsafe = request.user_key)
this is written in python3 ndb
this will return us key and we change in urlsafe
key = new_key.urlsafe()
key.decode(encoding="utf-8&...
1
vote
2
answers
30
views
TypeConversion of a string with float values to integer is throwing error
I have written the following code:
typConvInt = int('3.3')
print(typConvInt)
But compiler is throwing an error.
ErrorMessage:
Traceback (most recent call last):
File "E:\Trainings\...
2
votes
2
answers
70
views
Change mantissa in scientific notation from 0-1 instead of 1-10
I want to format a number so that the mantissa is between 0 and 1 instead of 1 and 10 in scientific notation.
For example;
a=7.365
print("{:.6e}".format(a))
This will output 7.365000e+00, ...
0
votes
0
answers
39
views
How to change the python version of a virtual enviremnet?
I am writing a Django React web app and I am required to install Dlib for a specific component to work (to install face_recognition library). However I am unable to do so because I used Python 3.12 to ...
0
votes
2
answers
37
views
Converting python 3 to 2.7.5 F string to .formated
I learned all of my python on 3.0 and greater and come to find out the server that I need to put my script on is 2.7.5 which means no f strings. I am having issues converting my script from F strings ...
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 ...
-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
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 ...
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 ...