Difference method vs attribut = function

2024-06-29 Thread Ulrich Goebel via Python-list
Hi, a class can have methods, and it can have attributes, which can hold a function. Both is well known, of course. My question: Is there any difference? The code snipped shows that both do what they should do. But __dict__ includes just the method, while dir detects the method and the attribu

Best Practice Virtual Environment

2024-10-05 Thread Ulrich Goebel via Python-list
Hi, I learned to use virtual environments where ever possible, and I learned to pip install the required packages there. That works quite nice at home. Now I come to deploy a Python script on a debian linux server, making it usable for a couple of users there. Debian (or even Python3 itself) d

TkInter Scrolled Listbox class?

2024-11-04 Thread Ulrich Goebel via Python-list
Hi, I would like to build a class ScrolledListbox, which can be packed somewhere in ttk.Frames. What I did is to build not really a scrolled Listbox but a Frame containing a Listbox and a Scrollbar: class FrameScrolledListbox(ttk.Frame): def __init__(self, *args, **kwargs): super().

Python 3.8 or later on Debian?

2024-09-18 Thread Ulrich Goebel via Python-list
Hi, Debian Linux seems to love Python 3.7 - that is shown by apt-get list, and it's installed on my Debian Server. But I need at least Python 3.8 Is there a repository which I can give to apt to get Python 3.8 or later? Or do I really have to install and compile these versions manually? I'm no