94,680 questions
1
vote
1
answer
49
views
Are GTK2 default translations accessible from Python
When using GTK2 with Python, there are some things like 'gtk-yes', 'gtk-open' which help in getting e.g. button names translated to the according user language.
What I am searching for are more of ...
0
votes
0
answers
41
views
Why does Python 2 forbid implicit __hash__ on old-style classes only?
When I override equality on a class in any language I have to be careful not to create an inconsistent hash function.
Python 3 and Python 2 with old-style classes help here by deleting the __hash__ ...
0
votes
1
answer
31
views
Python: problem with multiprocessing.Pool and deleting files (WindowsError: [Error 32])
I'm writing code in Python 2.7 (bigger framework compatibility reasons) that does the following:
Takes an ID_something.py file, opens it, reads the lines from it, then closes the file.
Creates an ...
2
votes
0
answers
157
views
Python code to get direct download file link from mediafire
I have updated my code to download files from mediafire like
https://app.mediafire.com/folder/cdmen9tqtpwxk.
if self.teamName == "BlackHole":
if boxtype == "dm920":
key ...
0
votes
0
answers
88
views
How do install pip/math module from configured python2.7 source
Ubuntu 25 (plucky)
how do I include the math and other modules when compiling from source?
https://docs.posit.co/resources/install-python-source.html
Compiling 2.7.4
Wasn’t able to use deadsnakes:ppa ...
1
vote
0
answers
35
views
How to manually trigger each NAO robot speech command one by one in a Python script (in VSCode)?
I’m running a Python script controlling four NAO robots using the naoqi API. The script runs in VSCode on my local machine, connected to each robot.
My goal is to have:
Robot 1 speak first with a ...
0
votes
1
answer
80
views
Running older versions of pylint in VS Code possible?
I need to run pylint 1.9.5 with a Python 2.7 environment in VS Code 2025, but I have not found a way to do so. Both of them are also not supported by the pylint extension.
I tried pointing VS Code's ...
1
vote
1
answer
217
views
python -v results zsh: command not found: python MacOS Sequoia 15.5 Beta
Why does the command "python -v" result in "zsh: command not found: python" on Mac, even though Python 2 used to come installed with the device?
I am working on an 2020 MacBook Pro ...
0
votes
1
answer
141
views
How to read metadata information from a file using SMB Protocol?
I need to determine the last modification date of a file obtained via the SMB Protocol. I am using a machine running RHEL 7.5, Python 2.7.5, and SMB Protocol version 1.5.1.
I tried the following, but ...
0
votes
0
answers
36
views
Complex DataBinding accepts as a data source either an IList or an IListSource. (Parameter 'value')
I'm a hobbyist developer writing Python code scripts inside CAD software (to help design and build RC model aircraft).
I recently upgraded the CAD software I use and in doing so, it upgraded the ...
-2
votes
2
answers
157
views
Unable to install get-pip.py 2.7 due to SSL error
We are using Python 2.7.3 and trying to install the compatible pip. Downloaded from https://bootstrap.pypa.io/pip/2.7/get-pip.py. When installing getting the below error.
Can someone help how to fix ...
0
votes
1
answer
158
views
Power Automate Desktop - import azure.storage.blob for Python 2.7/3.4
I am trying to perform the import of the azure.storage.blob module into a python script defined within the “Run Python Script” activity of Power Automate Desktop.
# Python 2.7 code
from azure.storage....
-1
votes
3
answers
116
views
can't install pillow neither packtools in Python 2.7.17
I mark articles for SciELO and I need to use Python 2.7.X to work with it, but when i try to install pillow, packtools and lxml the cmd points to "Could not find a version that satisfies the ...
0
votes
0
answers
21
views
How can we make an element tappable when Appium detects it and reports a successful click, but the action is not reflected in the app?
This issue is observed only on iOS 18 versions:
I'm trying to tap on an element ,which is a Cancel button, but the action is not reflected in the app. Upon checking the logs, I found that Appium ...
0
votes
1
answer
68
views
Can you make a class variable that calls an instance of the class?
I am working with a class which does some math and stores the result, and then a line that sets a "noresult" to that class but initiated with zeroes, like so (I'm leaving out the math, this ...
0
votes
1
answer
111
views
Xarray.open_dateset uses more than double the size of the file itself
All,
I am opening NetCDF files from Copernicus data center using xarray version 2024-11-0, using open_dataset function as the following:
import xarray as xr
file1=xr.open_dataset("2021-04.nc"...
0
votes
1
answer
269
views
cqlsh returns "ModuleNotFoundError: No module named 'six.moves'"
I have already installed "six" 1.7.2 in python 2.7.18 with pip, but i receive an error message anyway.
seva@seva-HLYL-WXX9:~$ python --version
Python 2.7.18
seva@seva-HLYL-WXX9:~$ pip ...
0
votes
1
answer
74
views
Python - Django - Encoding UTF-8
I have a problem with text encoding.
The context: I'm working on a django 1.11, python 3.6 app (it started in python 2.7 and django < 1.11 and was upgraded later).
I have to use an API that doesn't ...
0
votes
0
answers
103
views
Lamba Performance is very slow while fetching data from S3
I am beginner in AWS and want to get some advice for the below design that we are trying to implement at our side .
We are reading and fetch the content of bulk json files from S3 in the output ...
0
votes
1
answer
57
views
Rect() TypeError while converting from Python 2 to Python 3
I'm getting the weirdest error while converting an application from Python 2 to Python 3.
Briefly this application uses wxPython to create an interface where the user can draw different objects on a ...
-1
votes
1
answer
94
views
Why would a simple input statement cause a runtime error? (Work@tech IDE) NZEC error
Since replit has started charging for collaborative IDE's i've been trying to explore good alternatives.
I am experiencing NZEC error when trying to run a simple program such as:
answer = ""
...
0
votes
0
answers
36
views
Python 2.7: set up windows station for process to hide popup windows
I have a code like:
command = [<some exe>, <flags>, <arguments>]
process = subprocess.Popen(command, cwd=self.dirpath, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
...
1
vote
0
answers
53
views
ImportError when unpickling an object in Python 2.7
I have a pickled object of MyCustomClass. It is pickled using Python 2.7.8 builtin pickle module:
# mymodule.py
import pickle
class MyCustomClass:
def __init__(self):
attr1 = None
def ...
0
votes
0
answers
94
views
Is there a way to capture Event from focused Text widget before it gets to widget
QUESTION:
Is there a better way to do this? Can I hijack the Event before it reaches the focused Text widget? Or is emulating the behavior I want the best I can do?
PROBLEM:
Using Python 2.7 Tkinter....
1
vote
0
answers
124
views
opcua python2.7 -- Writing to OPC UA server using .set_values(nodes, values)
I'd like to write multiple nodes to the OPC UA server. Therefore I use the .set_values() method of the opcua lib. I've to use the opcua lib in cause of python version 2.7.
Using the .set_values() ...
0
votes
0
answers
55
views
Some widgets don't appear in the main app
I'm trying to make an GUI to launch Ansible playbook, I've done a main app container with a menu to swicth between different frame.
The main.py looks like this:
#!/usr/bin/python2.7
# -*- coding: utf-...
1
vote
0
answers
53
views
Python 2.7: difference between codecs.open(<f>, 'r', encoding=<enc>) and <string>.encode(<enc>)
What is the difference between code like this:
with codecs.open(<file path>, 'r', encoding='my_enc') as f:
json.load(f)
string = json['key']
and code like this:
with open(<file path>, ...
-4
votes
2
answers
129
views
How to turn a tuple of lists into a list? [closed]
I am using Python 2.7 to turn a tuple of lists (of 2 elements) of float into a list of floats (([1.0],[2.0]) => [1.0,2.0]) like the following:
[tuple_lists[0][0],tuple_lists[1][0]]
Is there a ...
0
votes
1
answer
841
views
When making a Python 2.7 venv in Pycharm, I am getting a syntax error and told it is using Python 3.11? How do I use Python 2.7?
I have a project that is in Python 2.7, it has to be in 2.7 and upgrading is NOT an option so please don't tell me I should just do that, I am using a python package for a specific software that has ...
-3
votes
1
answer
55
views
Transpose of a matrix_comp
given a matrix of 3*2 A= [[10,20],[74,25],[340,20]] to get output = [[10,30,-10,20],[74,99,49,25],[340,360,320,20]] where the 1st and 2nd col values will be the 1st and 4th col values and 2nd, 3rd col ...
0
votes
0
answers
55
views
Cannot install Database-library package in Python2 using pip
I am new to python and moving one test from one (working) to another physical machine (new).
in the process , One of python file has -> from DAL.database import DBC
when I do 'pip2 freeze' on both ...
0
votes
1
answer
57
views
CRITICAL: [Errno 104] Connection reset by peer in reviewboard [duplicate]
Am getting CRITICAL: [Errno 104] Connection reset by peer when i do
rbt post -o in reviewboard
1
vote
1
answer
39
views
Given a font and a specific character, is there a way to tell which subrange the character belongs to?
I need to determine if a given character in a given font belongs to a given subrange. For example, U+0041 according to Windows Character Map app belongs to the Latin Subrange. Is there a way to get ...
0
votes
0
answers
106
views
How to make my Telegram bot stop working at 16:15 and not work on Fridays?
I have a Telegram bot written in Python using the Telethon library. The bot is supposed to function from 10:00 to 16:15 from Saturday to Thursday, and it should be completely inactive on Fridays. ...
1
vote
1
answer
53
views
Python2 multiple repeat error not occurring in Python 3/Javascript [duplicate]
I'm running this duckduckgo tracker rule through redshift so am locked to python 2. In python 2 when I run this I get "multiple repeat" error. I'm guessing the + signs aren't escaped is ...
0
votes
1
answer
189
views
How to avoid "UserWarning: Reading `.npy` or `.npz` file required additional header parsing..."
I'm creating .npz files in Python 2 (yes, Python 2, not 3 and I can't change it) full of .npy files. When reading those .npz files, I'm having the warning message: "UserWarning: Reading .npy or ....
0
votes
1
answer
88
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&...
0
votes
0
answers
193
views
How to install pip for python 2.7 on ubuntu 23.10
There are some links such as here for instructions on how to install pip2 on ubuntu with python 2.7, however when I run
curl https://bootstrap.pypa.io/pip/2.7/get-pip.py --output get-pip.py
sudo ...
0
votes
0
answers
204
views
can't find the libraries meta_lib and meta_log in pypi
I was trying to use a legacy script from a qualcomm flashing package (Packaged for QFIL)
examining the script I found that it is:
Python 2.7.18 (I'm have little or no experience with it.
It makes ...
1
vote
2
answers
40
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
108
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
56
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 ...
1
vote
0
answers
75
views
Runing a script written for python2.7 using subprocess.run in a script written in python3.11
In my company there is a script: install.py that is written in python2.7.
The issue
I'm writing a script to run this script from my own python script which I've written in python3.11.
In the beginning ...
0
votes
2
answers
72
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 ...
1
vote
3
answers
502
views
Can I set up autocomplete in Visual Studio Code for Revit API stubs without having Revit installed?
My PC does not meet the minimum requirements to install Revit. I want to write API code in Visual Studio Code for use on another PC that does have Revit installed.
My settings in Visual Studio Code:
...
0
votes
0
answers
35
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 ...
2
votes
1
answer
130
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
121
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
132
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. ...
3
votes
3
answers
905
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 ...