Rowan maththias · Stack Overflow

Score of 1

1 answer

77 views

Reading from Postgres DB using Polars and filter on list of strings

I want to read from my Postgres database using Polars and filter a string column based on a list of values. E.g. assuming I have a Postgres connection called con: mylist = ['abc', '123'] with con: ...

  • reputation score 13

Score of 0

0 answers

103 views

Logic shared between instances and class methods [closed]

I have some values and associated logic. I have two classes that use that pattern. First one is a dataclass: @dataclass class A: data1: int def __post_init__(self): <check if data ...

  • reputation score 45

Score of 0

1 answer

79 views

BACnet/IP device discovery fails inside Kubernetes pod

I am running a Python BACnet client using BAC0 inside a Kubernetes pod. The BACnet devices are on the same physical network as the Kubernetes server. If I run the Python BAC0 client directly on the ...

  • reputation score 51

Score of -1

0 answers

88 views

PyCharm type hinting constraining improperly?

I'm running into a type hinting issue in PyCharm and can't figure out if I'm missing something about how this works or if PyCharm's type checker is bugged. From what I can see in the example below, ...

  • reputation score 1

Score of -4

3 answers

114 views

Create a board on the console for the game tic tac toe [closed]

I'm trying to build a board on the console like this with python: | 1 | 2 | 3 | | 4 | 5 | 6 | | 7 | 8 | 9 | My code to reach this is the following: a = [0,1,2,3,4,5,6,7,8] for i in range(len(a)): ...

  • reputation score 29

Score of -2

0 answers

97 views

Can Python's argparse handle multiple distinct usages?

I'm using Python and argparse to write a command-line utility (call it foo) that processes numeric input. There will be two distinct ways in which it can be used. The first is foo [file_names] which ...

  • reputation score 133

Score of 0

1 answer

64 views

How to make a Select All function for tkinter ScrolledText

from tkinter import scrolledtext, Tk, Button def copy(): try: txt = text.get('sel.first', 'sel.last') window.clipboard_append(txt) except tk.TclError: pass window = ...

  • reputation score 5

Score of 0

0 answers

53 views

KafkaAdminClient and threads in kafka-python

I see contradictory information about thread-safety of KafkaAdminClient class from kafka-python library. Documentation specifically says that KafkaProducer is thread safe and KafkaConsumer is not, but ...

  • reputation score 19

Score of 0

6 answers

223 views

Scan directories and copy those that have more than n files

I have an mp3 library in a music folder structured by artist/album/song.mp3 (or other extension, but the folder contain audio only, so extension doesn't matter here). I wish to copy this music ...

  • reputation score 35

Read the original on stackoverflow.com ↗