Re: Set tkinter top-level window to "always on visible workspace"

2022-03-27 Thread Skip Montanaro
> So you might tell your window manager to keep that window on the main workspace. Thanks. I'd forgotten about the possibility of doing this sort of thing in the window manager config. That would certainly be fine in this case. (It's been ages since I messed with this sort of thing.) Skip -- htt

Re: Set tkinter top-level window to "always on visible workspace"

2022-03-27 Thread Cameron Simpson
On 27Mar2022 16:23, Skip Montanaro wrote: >I have a tkinter app (Ubuntu/X11 env) whose main window should always be >displayed on the currently visible workspace. Is there some way to set that >attribute programmatically? I see that there is a tkinter.Wm class and that >Toplevel widgets have a wm_

Set tkinter top-level window to "always on visible workspace"

2022-03-27 Thread Skip Montanaro
I have a tkinter app (Ubuntu/X11 env) whose main window should always be displayed on the currently visible workspace. Is there some way to set that attribute programmatically? I see that there is a tkinter.Wm class and that Toplevel widgets have a wm_attributes method, but haven't found any exampl

Re: How to detect an undefined method?

2022-03-27 Thread Avi Gross via Python-list
The question seems to be how or whether you can check Python code in advance for any instances of a method for an object being called that is not instantiated. Right? As Kirill points out, Python can be quite dynamic. I can think of oodles of ways checking would not work well in a static examinati

Re: How to detect an undefined method?

2022-03-27 Thread Kirill Ratkin via Python-list
I just started to think from your example with method 'err' of logger object. In this particular case you can check method 'err' exists or not before call this. But if you mean general case ... . If for example I use some library which uses another library and someone just 'typo' there ...

Re: How to detect an undefined method?

2022-03-27 Thread Manfred Lotz
On 3/27/22 18:57, Kirill Ratkin wrote: > Hi > > You can get all methods of your object and check the method you want to call > is > there or not. > > |methods = [method for method in dir() if > callable(getattr(, method))] if 'method_you_need' in methods: > . // BR | > I don't understand how t

Re: How to detect an undefined method?

2022-03-27 Thread Manfred Lotz
On 3/27/22 18:36, Skip Montanaro wrote: >> Let's say I have a Python app and have used an undefined method somewhere. >> Let >> us further assume I have not detected it thru my tests. >> >> Is there a way to detect it before deploying the app? pylint doesn't >> notice it. >> > > This is maybe not

Re: How to detect an undefined method?

2022-03-27 Thread Manfred Lotz
On 3/27/22 18:12, Peter Otten wrote: > On 27/03/2022 11:24, Manfred Lotz wrote: >> Let's say I have a Python app and have used an undefined method somewhere. >> Let >> us further assume I have not detected it thru my tests. >> >> Is there a way to detect it before deploying the app? pylint doesn't

Re: How to detect an undefined method?

2022-03-27 Thread Kirill Ratkin via Python-list
Hi You can get all methods of your object and check the method you want to call is there or not. |methods = [method for method in dir() if callable(getattr(, method))] if 'method_you_need' in methods: . // BR | 27.03.2022 12:24, Manfred Lotz пишет: Let's say I have a Python app and have u

Re: How to detect an undefined method?

2022-03-27 Thread Skip Montanaro
> Let's say I have a Python app and have used an undefined method somewhere. > Let > us further assume I have not detected it thru my tests. > > Is there a way to detect it before deploying the app? pylint doesn't > notice it. > This is maybe not exactly what you're looking for, but writing a test

Re: How to detect an undefined method?

2022-03-27 Thread Peter Otten
On 27/03/2022 11:24, Manfred Lotz wrote: Let's say I have a Python app and have used an undefined method somewhere. Let us further assume I have not detected it thru my tests. Is there a way to detect it before deploying the app? pylint doesn't notice it. Minimal example: #!/usr/bin/env pytho

Re: How to detect an undefined method?

2022-03-27 Thread dn
On 27/03/2022 22.24, Manfred Lotz wrote: > Let's say I have a Python app and have used an undefined method somewhere. Let > us further assume I have not detected it thru my tests. > > Is there a way to detect it before deploying the app? pylint doesn't notice > it. A competent IDE will 'find' s

How to detect an undefined method?

2022-03-27 Thread Manfred Lotz
Let's say I have a Python app and have used an undefined method somewhere. Let us further assume I have not detected it thru my tests. Is there a way to detect it before deploying the app? pylint doesn't notice it. Minimal example: #!/usr/bin/env python3 import logging from logging import Logg