Questions tagged [python-3.x]
DO NOT USE UNLESS YOUR QUESTION IS FOR PYTHON 3 ONLY. Always use alongside the standard [python] tag.
341,404
questions
0
votes
0
answers
4
views
Coroutine is not awaited ThredPoolExecutor
I have a ThreadPool set up like so:
with ThreadPoolExecutor() as pool:
futures = [pool.submit(called_function, args) for args in list_args]
wait(futures)
I am getting the following error:
...
0
votes
0
answers
8
views
LegiScan API getBillText hooks
For a given bill, with an associated document_id, I want to retrieve the text. Per page 16 of the API User Manual these are Base64 encoded strings of the MIME document object. The trouble is making it ...
-2
votes
0
answers
8
views
Creating a wrapper for a Python3 based project with Django
Calling for help!!
I have a python3 based project (it's a huge one with a lot of command line interfaces and tools/scripts running off of it) that's basically used as a resource repo. This was ...
0
votes
0
answers
5
views
Semantic-search in large documents
I am working on a project where I need to develop a program that identifies sentences from a predefined list, within a large document. The goal is to find the closest matches based on semantic meaning,...
0
votes
0
answers
13
views
Python customtkinter messagebox() [closed]
How to cause a sharp error window in this library?Please help Google didn't give anything, p s I'm a beginner just learning. Don't beat ;c Example on tkinter tkinter itself.messagebox How to cause a ...
0
votes
1
answer
14
views
How to prevent the user from changing some fields in Django Rest?
My Django REST application has an entity where during creation/update some fields are set by the backend and not by the user, but the user can still submit requests to update these fields.
Fields to ...
0
votes
0
answers
6
views
Trying to retrieve Region(State) and City and Campaign Metrics from Google Ads campaigns
Im trying to make a GAQL to retrieve some data like Clicks, Impressions from my campaigns separated by City and State (Like NY or FL or CA)
I'm using Python and google-ads = "^21.3.0" to ...
0
votes
1
answer
35
views
OverflowError: int too big to convert
Trying to generate randomized phrases, but keep getting error: OverflowError: int too big to convert
Tried numpy array but it didn't solve the issue, tried int32 and 64 but still got the same error, ...
0
votes
0
answers
10
views
Program not returning the result despite running through the lines
I wrote this solution for the leetcode question https://leetcode.com/problems/search-in-rotated-sorted-array/
What i m perplexed about is that desite entering the first and the third if statement, my ...
0
votes
1
answer
8
views
wxPython: Changing to other panel in the frame hides the first panel, but displays a tiny box at the top left corner instead of the other panel
My app frame contains a default large panel and two sub-panels inside it. When clicking on a particular menu-item, I want this default panel to change to another panel. My code:
This is the main frame ...
0
votes
1
answer
11
views
Getting null responses while using marshal_with for getting data
So, I am working on my self learning on flask, in order to one my problem with enums, I am using marshal_with, which one of user suggested me.. Now I have problem getting data for invalid ids..
I am ...
0
votes
0
answers
12
views
pyttsx3 and python 3.11.5 on OSX Ventura 13.6
I am trying to run this program:
import pyttsx3
engine = pyttsx3.init()
engine.say("Hello, how are you today?")
engine.runAndWait()
But I am getting this error and I dont know where to ...
0
votes
0
answers
19
views
Tensorflow problem with a task that seems quite easy
I have a simple task.
I have 2 sets of video screenshots.
In one folder i have screenshots containing a "strap" with video artist and title.
In second folder i have screenshots without the ...
0
votes
1
answer
25
views
How do I position my tkinter widgets right?
I am making a simple tkinter app and I want to make the layout look better.
The layout currently looks like this:
Simple Image
But I want it to look like this:
Wanted Image
The code for it is right ...
-1
votes
0
answers
8
views
2D and 3D maps from .xyz files
I have an .xyz file of elevation points (example of the points in the image). I would like to make a 2D and 3D map, but I have no idea how to do it, I would appreciate help!
-117.29607,32.62974,-82....
0
votes
1
answer
15
views
OOP Python: Call child class method in Parent class method
I'm trying to understand what is the best way of letting Base Class X know that there will be a certain method in child class. Simplified example of my problem is:
class X:
def __init__(self, v1):
...
0
votes
0
answers
11
views
importing requests module throws error in FastAPI application
I'm using Python3.8, creating a FastAPI application and trying to import requests module. This throws error "ModuleNotFoundError: No module named 'requests'"
However, in the Python terminal, ...
0
votes
0
answers
10
views
Calculate file number by incrementing a constant value till tuesday followed by a monday of every month
I have a constant value in file name. The value increases by 1 everyday
for 5 days in a week(tuesday-saturday).
I have a file A which comes in every month on the Tuesday followed by the first Monday ...
0
votes
1
answer
34
views
Is there a way to make tkinter widget attributes global?
I am making a simple calculator using python and tkinter and I wanted to save code by making global attributes.
I am new to stackoverflow so please if I asked the question wrong please edit it.
I ...
0
votes
0
answers
9
views
When I try to install package pyo on Mac m2 the terminal print this how can I fix this?
gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -arch x86_64 -g -DUSE_PORTAUDIO -DUSE_PORTMIDI -DUSE_OSC -Iinclude -I/usr/local/Cellar/liblo/...
-1
votes
3
answers
64
views
How can I sort this list by date?
I have a problem to sort my list by date.
Here is the code.
a = ['28/09 Fenerbahçe Başakşehir FK : 3.0 Normal', '29/09 Samsunspor Gaziantep FK : 2.25 Normal', '30/09 Sivasspor Hatayspor : 2.33 Normal',...
0
votes
1
answer
11
views
dd prefix to duplicate values AND add new rows with this values to a certain groups in pandas
I have a df such as
Type Species Value
Dog Species2 100
Dog Species1 200
Dog Species3 300
Dog Species3 900
ALL_ Species1 400
ALL_ Species2 500
ALL_ Species3 ...
0
votes
0
answers
16
views
Finding the noun phrase and dependency
I'm trying to find a noun phrase from a set of sentences and output whether the sentence is true or false based on its presence.
For an example, following are four samples
s1 = "he reported red ...
0
votes
0
answers
10
views
Add suffix number to duplicated groups and add rows for duplicated values in a df in Pandas [duplicate]
I have a df such as
Type Species Value
Dog Species2 100
Dog Species1 200
Dog Species3 300
Dog Species3 900
ALL_ Species1 400
ALL_ Species2 500
ALL_ Species3 ...
0
votes
1
answer
14
views
Pywinauto menu_select AttributeError
I want to automate Windows application using pywinauto and I got stuck with selecting Menu bar option. I receive AttributeError when I use menu_select function.
Python 3.11.5
pywinauto 0.6.8
GUI
Code:
...
1
vote
2
answers
31
views
convert a list of neighbours to a list of connected-nodes-groups?
I have a list of neighbours for each node and need to have a list of groups of neighbouring nodes.
The Numbers in the input lists are the indexes of neighbouring nodes.
Example: [(1, ), (0, ), (3, 4), ...
0
votes
0
answers
17
views
Runtime Error due to multiprocessing in Python
I am attempting to use the Seq2Pat python library for the first time. Everything seemed to install correctly for the library, Cython, and the compiler. When running a test script for the first time (...
0
votes
0
answers
16
views
python3 TypeError: string argument expected, got 'bytes'
getting the following error on these lines, here is the code:
import subprocess
from io import StringIO
image1, buffer1 = captureTestImage(str(cameraSettings), str(testWidth), str(testHeight))
...
0
votes
1
answer
25
views
Python recursion list search
I've worked up a simple recursive python method to search a list that can be run, but fails to return the desired result. I realise a base case (an empty list here) is needed and to build from there.
...
0
votes
1
answer
19
views
Executable made with Pyinstaller doens't work in another computer
I'm pretty new in python programming and I made a program using Tkinter that do some calculations with some info that I take from Xml files.
So the problem is that I have to export this program to ...
1
vote
2
answers
54
views
How to properly use type hints in Python?
I can't figure out how to properly use type hints in my type_casting function.
def type_casting(var, _type):
if _type not in (str, int, float, bool):
return Exception
return _type(var)...
0
votes
0
answers
6
views
installing python's pycraf on AWS linux AMI
How can I get pycraf python library (https://bwinkel.github.io/pycraf/install.html#linux) installed on aws linux?
Initially, I used the linux's python3.9 and pip to install from the source by doing ...
0
votes
0
answers
24
views
I want to make a sumdoku solver [closed]
I need your help to complete the sumdoku solver.
I have completed a puzzle generation program called sumdoku and would like to create a solver to check if the generated program has another solution.
...
0
votes
0
answers
35
views
Is there a way to replace <class '__main__.CLASS NAME'> in python
I was trying to make a class that can return a specified "key" or uuid to brute force a function in a specific mode. is there a way by juts typing in the function perimeters the class name ...
0
votes
0
answers
41
views
How to get the cost details for a particular resource group from azure using python?
I am using the below code to get the list of resource groups. But I need to check the cost details for the resource groups coming up for each of them. Which module will support for this and what are ...
-3
votes
1
answer
55
views
How to get the last character of a string that is in a list in python? [closed]
I'm trying to check if the last character of a specific string from a list is a comma.
I've tried the following:
x=["pingas", "mingas,", "dingas"]
for y in range(len(x)):...
1
vote
0
answers
9
views
Recovery .py from .exe python created by cx_Freeze
I created a .exe python using cx_Freeze and it runs normally. I had a problem with my SSD e I lost my script. Is it possible get script back from some folder of lib of .exe?
Somebody has a solution of ...
0
votes
0
answers
10
views
How to parse a date as an argument in xlwings
I would like to parse a date as an argument in a python function but it is not recognized.
For example:
def myfunction(cob_ToGet):
# cob_ToGet is datetime
print(cob_ToGet.strftime("%d.%m.%...
-1
votes
0
answers
22
views
Multitask learning Keras: different convergence rates for outputs [closed]
I'm building a Multi-task machine learning algorithm in Keras with 2 outputs. The model consists of some shared convolutional/dense layers before splitting off into the 2 task specific heads. One ...
0
votes
0
answers
10
views
How to send email when we got fail/success msg in logger in python program
I'm very new to the python i need anyone help on current problem
the problem is when i get success or fail in current task i need to send email with success/fail subject and details
i'm able to send ...
0
votes
0
answers
8
views
Couldn't install p5 library for python 3.11.5 because it failed to build wheel for Pillow and PyOpenGL-accelerate
Here is the commands I used in he command prompt and the output it gave:
src\wrapper.c(28232): error C2037: left of 'f_lineno' specifies undefined struct/union '_frame'
error: command 'C:\\...
0
votes
1
answer
35
views
OR TOOLS SAT Ray tracing algorithm and toggle a boolean
I guys, I am trying to implement a ray tracing algorithm to check if a point lies inside a polygon. I got this python code and I am trying to implement the following part in CP-SAT
int pnpoly(int ...
0
votes
1
answer
48
views
Please explain how recursion works in this specific example
I've just started university and have got a python programming class.
I've gotten an assignment where i have to write code which takes a string and splits it into "small letters, this symbol __, ...
0
votes
0
answers
17
views
FastAPI: how to return JSONResponse and StreamingResponse
Is it possible to return both a json and a zip file at the same time with FastAPI ?
This is the tentative endpoint but it doesn't work:
@app.post("/search")
async def structure_search()
...
1
vote
3
answers
70
views
sum of two list of dictionaries by some key and merged to result
I have two list of dictionaries:
list_of_dicts = [{'a': 1, 'name1': "jane"}, {'b': 2, 'name1': 'jack'}, {'c': 3, 'name1': 'nak'},{'d': 3, 'name1': 'nak'}]
dict_to_check = [{'a': 1, 'name2': &...
2
votes
4
answers
62
views
why is (true or false and false) True?
why is this printing 'yes' I don't understand
I understand that x or y returns true but x and z should return false or is the order it compares different
x=True
y=False
z=False
if(x or y and z):
...
1
vote
1
answer
34
views
Python import issue when running file as __main__
This is the directory structure of my project.
.
├── args_parser.py
├── driver.py
├── event.py
├── logs
├── main.py
├── requirements.txt
├── scrap_results
├── sites
│ │
│ ├── tentimes.py
└──......
0
votes
0
answers
16
views
comparing twp pdf and highlighting the differences using python
` I receive two PDFs on a daily basis which have roughly the same format and data, but sometimes there are inconsistencies. Currently I have to manually check them side by side to note any errors. ...
1
vote
0
answers
13
views
how to initialize a different object for different sub-process of tornado-based application?
The following are my code:
class PromptHandler(tornado.web.RequestHandler):
def initialize(self, obj):
self.obj = obj
async def get(self):
self.write('OK')
def make_app(obj):
...
0
votes
1
answer
23
views
Bulk load data issue in python
I want to bulk load the data into snowflake warehouse using pandas. Please find whole requirement below:
I have source data in snowflake table. I am reading the same in a dataframe.
After loading the ...