Skip to main content

Question list filters

Filter by
Sorted by
Tagged with
Score of -2
0 answers
18 views

pygame-ce 2.5.7 (SDL 2.28.4, Python 3.12.12) \>>> Task exception was never retrieved future: <Task finished name='main' coro=<main() done, defined at <console>:3> exception=...
Score of -6
2 answers
137 views

I have this pricing function in a Python e-commerce application: def apply_discount(price, discount): return price * (1 - discount) It works correctly for normal inputs: apply_discount(100, 0....
Score of -2
1 answer
71 views

When installing requests with UV, VS code cannot find requests module, but the script runs from the command line. uv python list cpython-3.12.3-linux-x86_64-gnu /usr/bin/python3.12 ...
Score of -2
1 answer
111 views

I'm trying to send an email from my Outlook account to Gmail using Python's smtplib. I set up SMTP with Office 365 (smtp.office365.com:587) and credentials but get a "550 5.7.1 Client does not ...
Score of 1
0 answers
96 views

I use VScode on Windows 10. I run a subprocess using the subprocess module. but it closes if I kill the parent process, whether I kill it with VScode or with os.kill(os.getpid()). I tried many things ...
Score of 1
1 answer
98 views

Why isn't Pyright complaining about this? msg: Any is not a Message. (Pylance 2026.3.1) import asyncio from dataclasses import dataclass import json @dataclass(frozen=True, slots=True) class Message: ...
Score of -10
0 answers
126 views

# title print('This is a BMI calculator') # this asks what sytem to use imp_or_met = input('Metric or imperial? (all caps) ') # this is the code to get you BMI using metric values if imp_or_met == '...
Score of 0
1 answer
131 views

Typically, I would obtain/return an item from a list of items like so: def search_in_list(search_id): for item in my_list: if item['id'] == search_id: return item return ...
Score of 4
2 answers
184 views

I have a function that takes one or more arguments and returns the same number of values. For a single input value, it returns just one value, not a size one tuple, for multiple values it returns a ...
Score of -5
0 answers
81 views

I have been using buildozer==1.5.0 to build my APKs for sometime now since I have understood the basics. I use Arch Linux and I have learnt to build a specific Virtual Environment(which the one I have ...
Score of 0
0 answers
62 views

In PySide6, I'm trying to create a custom widget and register it as a plugin in Qt Designer. My widget has one attribute that is an enum. It displays correctly in Qt Designer, I can change the value ...
Score of 5
1 answer
149 views

I am trying to understand a surprising difference in object lifetime in Python asyncio. Consider this simplified example: import asyncio import gc import weakref class Resource: def __init__(self, ...
Score of -3
1 answer
123 views

Mac os Sequoia 15.6 I installed the exifread library using pip as well as conda. In Anaconda Navigator it shows as installed. Using a terminal window I type in: pip3 show exifread and it returns /opt/...
Score of -5
1 answer
189 views

edit: sorry I wasn't up to the standards, I thought I had everything in order. That said, thanks for the people that answered and helped, file.seek(0) worked! I really couldn't find anything online ...
Score of 2
1 answer
135 views

Let's say I have a conditional calculation like this import numpy as np def foo(a, b, c): if a <= 0 or c == 0: return foo_special(a, b, c) return foo_normal(a, b, c) def ...

15 30 50 per page
1
2 3 4 5
146977