Questions tagged [python]

Python is a multi-paradigm, dynamically typed, multi-purpose programming language. It is designed to be quick to learn, understand, and use, and enforces a clean and uniform syntax. Please note that Python 2 is officially out of support as of 2020-01-01. For version-specific Python questions, add the [python-2.7] or [python-3.x] tag. When using a Python variant (e.g. Jython, PyPy) or library (e.g. Pandas, NumPy), please include it in the tags.

0 votes
0 answers
6 views

Calculate attributes with subclass parameters

Im working in small python program wich several classes and subclasses. The main point is that I need to calculate de value of the main class with the attributes of the subclasses. class Product: ...
user avatar
0 votes
0 answers
9 views

Subtract df1 from df2, df2 from df3 and so on from all data from folder

I have a few data frames as CSV files in the folder. example1_result.csv example2_result.csv example3_result.csv example4_result.csv example5_result.csv My each data frame looks like following ...
user avatar
0 votes
0 answers
14 views

The longest prefix that is also suffix of two lists

So I have two lists: def function(w,w2): => this is how I want to define my function (no more inputs than this 2 lists) I want to know the biggest prefix of w which is also suffix of w2. How can I ...
user avatar
0 votes
0 answers
6 views

Constant camera grabbing with OpenCV & Python multiprocessing - Follow up

This is a followup on 'Programming Solution/questions/72469003/constant-camera-grabbing-with-opencv-python-multiprocessing', where @Aaron helped quite a lot. Context: OpenCV, Python, a USB Webcam ...
user avatar
  • 568
0 votes
0 answers
6 views

Psycopg / asyncio set even loop policy

Hope you're well! I have a problem with the Psycopg module allowing to interact with the PostgreSQL database. When I start my HTTP server (I use FastAPI and Uvicorn) normally, and I send a request to ...
user avatar
0 votes
1 answer
15 views

Cannot Increment Product count stored in a nested Dictionary - Pyhton OOP

So, I am working on my OOP concepts and knowledge by creating dummy projects. Right now I am creating like an online shopping system where admins can upload different products and users can purchase ...
user avatar
-1 votes
0 answers
9 views

My code in terminal in vs code is disabled how to enable?

How to enable running script in visual studio in windows 11? When I'm running visual studio code terminal is said that my running script is disabled how can I fix it?
user avatar
0 votes
0 answers
6 views

Setting up loggers from a config file

I have a bunch of python scripts for my project and I want to implement logging configurations on them. So I have 2 loggers (log1, log2) all three have different levels, formatters and file handlers. ...
user avatar
0 votes
0 answers
13 views

(Python Arcade) im trying to make a gui screen with buttons before my game

im trying to add a gui with play game, settings, and quit buttons for my basic 2d zombie shooter game for a school assessment, but when i run the code, it has this error: line 195, in on_draw self....
user avatar
  • 21
0 votes
0 answers
8 views

How to use my own validation data set in tensor flow for a prediction model?

I know that for training you model and see the accuracy you must use something like this: print("Fit model on training data") history = model.fit( X_train, y_train, batch_size=64,...
user avatar
-5 votes
0 answers
34 views

a school homework I don't know how to do [closed]

This is the question, can someone pls answer? (this is in python btw) Have the user enter the number of items they want to purchase. Have the user enter the prices of the items they want to purchase. ...
user avatar
  • 1
0 votes
0 answers
7 views

sslmode value "require" invalid when SSL support is not compiled in

I'm trying to run my python code on AWS Lambda to send data to my postgres DB on Heroku. The code works totally fine in my local, but when I test it on AWS, I keep getting this error message: [ERROR] ...
user avatar
0 votes
0 answers
14 views

Hide automated app window in python script

I am using docx2pdf in python to batch convert some files. On a mac, docx2pdf uses JXA (Javascript for Automation, aka AppleScript in JS) and thus opens an instance of Microsoft Word while performing ...
user avatar
0 votes
0 answers
11 views

Receiving a full image from a TCP socket communication

I have a TCP communication where my client continuously sends images as a byte array to a server and receives a response back, my problem is that when the server receives the images they are not done ...
user avatar
  • 353
0 votes
1 answer
27 views

Is there a way to find out which condition (out of many by using or) in "if" is evaluated to true because of which it entered inside the if? [duplicate]

I have an if statement, let's say: if cond1 or cond2 or cond3: do_something() Can I find out which among these three conditions (cond1,cond2 and cond3) was true because of which it entered ...
user avatar

15 30 50 per page
1
2 3 4 5
131305