Questions tagged [python-3.x]
DO NOT USE UNLESS YOUR QUESTION IS FOR PYTHON 3 ONLY. Always use alongside the standard [python] tag.
python-3.x
343,497
questions
0
votes
0
answers
8
views
pymssql package '_bcp_batch' in Mac M3 chip
I have a Mac with M3 chip and I get an error when I use python3.10^:
File "src/pymssql/_pymssql.pyx", line 1, in init pymssql._pymssql
ImportError: dlopen(/Library/Frameworks/Python....
-1
votes
3
answers
32
views
What is the correct way to unpack a tuple composed of a TreeNode and an Integer?
I'm implementing an algorithm that requires appending and popping nodes from a Tree in python (in a FIFO way).
queue = [] # empty list
root = TreeNode() # a standard TreeNode with val, left and ...
0
votes
0
answers
9
views
Python3: How to grab Alt key without swallowing it?
Overview
I'm implementing Alt-Tab functionality for i3wm. To do so, I'm writing a Python3 program communicating with i3 using the i3ipc package.
I use the Xlib package to grab "Alt-Tab", so ...
-4
votes
0
answers
11
views
Ultralitics YOLO would not work on my GPU (AMD Radeon Graphics, 512MiB) Python-3.12.3 torch-2.3.1+rocm6.0 CUDA:0 [closed]
While tried to train with GPU[Python-3.12.3 torch-2.3.1+rocm6.0 CUDA:0 (AMD Radeon Graphics, 512MiB)] it will not work, while I am using CPU[Python-3.12.3 torch-2.3.1+rocm6.0 CPU (AMD Ryzen 3 7320U ...
0
votes
0
answers
9
views
Make tkinter bind use keycode rather than keysym for language agnostic bindings
I'm working on tkinter python programs where I need to switch between Greek and other languages for input. My problem is that I then have to rewrite every key binding using and check for keycode to ...
0
votes
0
answers
11
views
How to add value to mood in an mp3 file via mutagen (Python)?
I couldn't find a way to write mood to an mp3 file via mutagen (Python library)
Initializing:
from mutagen.mp3 import MP3
from mutagen.id3 import ID3, TIT2, TALB, TPE1, TPE2, TCON, TPUB, TENC, TIT3, ...
-2
votes
1
answer
13
views
Replacing part of string with re.sub with number and string
I want to replace part of a string based on re.sub method as below
import re
re.sub("([0-9]_F)$", '[0-9]_DO', 'sdsd3_F')
However I fail to manage the numerical part of match which is also a ...
0
votes
0
answers
13
views
Listbox not showing or 2 forms tkinter
I call another form with this one and the listboxes of the second for are either not displays when I add the self.destroy() in the function where it is called there are displayed in two forms when I ...
1
vote
2
answers
34
views
Converting JSON list with multiple nested dictionaries to csv or excel
I have a JSON that I download from a website that has multiple nested dictionaries inside the main list. This is a very simplified version of it.
[
{
"id": 1,
"...
-1
votes
0
answers
8
views
ROS package src folder not being reached by scripts
I have a ROS 1 workspace where one of the nodes is currenly having issues importing things.
My file structure looks like this
catkin_ws/
├── src/
│ └── MyPackage/
│ ├── CMakeLists.txt
│ ├...
0
votes
0
answers
13
views
How to Create a Token Using Django REST Framework?
I am trying to implement token-based authentication in my Django project using Django REST Framework, but I am unsure of the steps required to create and manage tokens.
I Installed Django REST ...
1
vote
0
answers
17
views
Converting pigpio code to Gpiod library python
I have the following code of pigpio library and I have to convert it's functionality using gpiod library. Where pigpio has a good documentation I can understand the working of previous code using that....
0
votes
0
answers
28
views
StringVar doesn't update the text on a button in Python's TKinter
StringVar doesn't update the text on a button in Python's TKinter. As a matter of fct, no text is being shown. Why? I'm using Spyder 5.5.5.
Here's the code:
# -*- coding: utf-8 -*-
import tkinter as ...
0
votes
1
answer
15
views
How to store a response from one test case and use it in another test case in Pytest
Store Response from test_component_approval_request and Use in Another Test Case
Description:
We need to store the component_id from the response of the test_component_approval_request test case and ...
0
votes
0
answers
9
views
Raspberry Pi code error: 'RuntimeError: failed to add edge detection'
My code has been having issues, it is possible I may have to reflash the memory card with new OS since it worked previously on another Rasp Pi Zero 2.
But if anyone can help with this problem so it ...