Re: A natural magnet for the craziest TKinter lovers out there

2023-01-19 Thread Thomas Passin

On 1/19/2023 10:21 AM, Dan Kolis wrote:

Hello !


Works fine on my work machine. (Ubuntu 20.04 / 32 G / 32 CPUS). Scalene 
(https://github.com/plasma-umass/scalene) shows it using 9 MB of memory.



I ran your test program here and it generates 25 windows on my machine,
and I can click "run" at least half a dozen times. I tried closing the
font windows before clicking run again, and also just leaving the
windows up and generating many more windows. 300 windows. No hangs here
at all. Fedora 35 with Mate Desktop on X11 with compositing enabled.



Thanks a lot These reports are very helpful !

I seemed to have 'fixed it' by changing one line, really. I used:

 # Do each thing
..for aWs in workWsL:
aWs.update()


TO:
 # Do each thing
..for aWs in workWsL:
aWs.update_idletasks()


I was going to suggest update_idletasks(), but I forgot to scan your 
code to see it it was already being done.



Dan says:
Thanks a lot ! This helps me visualise this is managed as a problem in a 
technical sense. I mean, there is always a requirement for real integration 
testing of all sorts for an attempt to release a program on a larger scale.

Now I know it works without stopping on 4 computers. Better then yesterday 
hugely.

  Thank you.

Regs
Daniel B. Kolis

my ref: nafl, 19 Jan 2023, 
https://groups.google.com/g/comp.lang.python/c/FNlXg0Od39o/m/9stiUtLSAQAJ










--
https://mail.python.org/mailman/listinfo/python-list


Re: A natural magnet for the craziest TKinter lovers out there

2023-01-19 Thread Dan Kolis
Hello !

> Works fine on my work machine. (Ubuntu 20.04 / 32 G / 32 CPUS). Scalene 
> (https://github.com/plasma-umass/scalene) shows it using 9 MB of memory. 

> I ran your test program here and it generates 25 windows on my machine, 
> and I can click "run" at least half a dozen times. I tried closing the 
> font windows before clicking run again, and also just leaving the 
> windows up and generating many more windows. 300 windows. No hangs here 
> at all. Fedora 35 with Mate Desktop on X11 with compositing enabled. 


Thanks a lot These reports are very helpful !

I seemed to have 'fixed it' by changing one line, really. I used:

# Do each thing
..for aWs in workWsL:
aWs.update()


TO:
# Do each thing
..for aWs in workWsL:
aWs.update_idletasks()   


Dan says:
Thanks a lot ! This helps me visualise this is managed as a problem in a 
technical sense. I mean, there is always a requirement for real integration 
testing of all sorts for an attempt to release a program on a larger scale.

Now I know it works without stopping on 4 computers. Better then yesterday 
hugely.

 Thank you.

Regs
Daniel B. Kolis

my ref: nafl, 19 Jan 2023, 
https://groups.google.com/g/comp.lang.python/c/FNlXg0Od39o/m/9stiUtLSAQAJ








-- 
https://mail.python.org/mailman/listinfo/python-list


Re: A natural magnet for the craziest TKinter lovers out there

2023-01-19 Thread Thomas Passin
Works through 20 presses of the "go" button on a Linux Mint VM.  Because 
of limited RAM allocated for the VM, after some iterations the program 
slowed down because the VM had to start using swap memory.  But there 
did not seem to be any glitches or failures.


Python 3.9.5
Linux Mint 20 Ulyana /Cinnamon 3.07 GB
Linux kernel  5.4.0-137-generic
tk: 0.1.0


On 1/19/2023 10:06 AM, Thomas Passin wrote:
Works fine through 10 "go" button presses on my Windows 10 machine.  You 
might want to run pylint and pyflakes on it


On 1/19/2023 7:34 AM, Weatherby,Gerard wrote:
Works fine on my work machine. (Ubuntu 20.04 / 32 G / 32 CPUS). 
Scalene (https://github.com/plasma-umass/scalene) shows it using 9 MB 
of memory.


From: Python-list  
on behalf of Michael Torrie 

Date: Wednesday, January 18, 2023 at 8:58 PM
To: python-list@python.org 
Subject: Re: A natural magnet for the craziest TKinter lovers out there
*** Attention: This is an external email. Use caution responding, 
opening attachments or clicking on links. ***


On 1/18/23 18:01, Dan Kolis wrote:
Hangs after maybe between 4 and 50 screen rewrites. sometimes CTRL C 
under Ubuntu starts it up again. Click go rewrites al the fonts the 
thing can find in a few windows Repeated.




Not sure what you mean by "screen rewrites."

I ran your test program here and it generates 25 windows on my machine,
and I can click "run" at least half a dozen times. I tried closing the
font windows before clicking run again, and also just leaving the
windows up and generating many more windows.  300 windows. No hangs here
at all. Fedora 35 with Mate Desktop on X11 with compositing enabled.

--
https://urldefense.com/v3/__https://mail.python.org/mailman/listinfo/python-list__;!!Cn_UX_p3!iGQaGdd9t2QPVQJDhyDTQmXgCwx4YG7m8jFbRd11dF1BweJHCd0wC4UyZUfQGQjqxeulMYagnDqInfA81A$<https://urldefense.com/v3/__https:/mail.python.org/mailman/listinfo/python-list__;!!Cn_UX_p3!iGQaGdd9t2QPVQJDhyDTQmXgCwx4YG7m8jFbRd11dF1BweJHCd0wC4UyZUfQGQjqxeulMYagnDqInfA81A$>




--
https://mail.python.org/mailman/listinfo/python-list


Re: A natural magnet for the craziest TKinter lovers out there

2023-01-19 Thread Thomas Passin
Works fine through 10 "go" button presses on my Windows 10 machine.  You 
might want to run pylint and pyflakes on it


On 1/19/2023 7:34 AM, Weatherby,Gerard wrote:

Works fine on my work machine. (Ubuntu 20.04 / 32 G / 32 CPUS). Scalene 
(https://github.com/plasma-umass/scalene) shows it using 9 MB of memory.

From: Python-list  on behalf of 
Michael Torrie 
Date: Wednesday, January 18, 2023 at 8:58 PM
To: python-list@python.org 
Subject: Re: A natural magnet for the craziest TKinter lovers out there
*** Attention: This is an external email. Use caution responding, opening 
attachments or clicking on links. ***

On 1/18/23 18:01, Dan Kolis wrote:

Hangs after maybe between 4 and 50 screen rewrites. sometimes CTRL C under 
Ubuntu starts it up again. Click go rewrites al the fonts the thing can find in 
a few windows Repeated.



Not sure what you mean by "screen rewrites."

I ran your test program here and it generates 25 windows on my machine,
and I can click "run" at least half a dozen times. I tried closing the
font windows before clicking run again, and also just leaving the
windows up and generating many more windows.  300 windows. No hangs here
at all. Fedora 35 with Mate Desktop on X11 with compositing enabled.

--
https://urldefense.com/v3/__https://mail.python.org/mailman/listinfo/python-list__;!!Cn_UX_p3!iGQaGdd9t2QPVQJDhyDTQmXgCwx4YG7m8jFbRd11dF1BweJHCd0wC4UyZUfQGQjqxeulMYagnDqInfA81A$<https://urldefense.com/v3/__https:/mail.python.org/mailman/listinfo/python-list__;!!Cn_UX_p3!iGQaGdd9t2QPVQJDhyDTQmXgCwx4YG7m8jFbRd11dF1BweJHCd0wC4UyZUfQGQjqxeulMYagnDqInfA81A$>


--
https://mail.python.org/mailman/listinfo/python-list


Re: A natural magnet for the craziest TKinter lovers out there

2023-01-19 Thread Weatherby,Gerard
Works fine on my work machine. (Ubuntu 20.04 / 32 G / 32 CPUS). Scalene 
(https://github.com/plasma-umass/scalene) shows it using 9 MB of memory.

From: Python-list  on 
behalf of Michael Torrie 
Date: Wednesday, January 18, 2023 at 8:58 PM
To: python-list@python.org 
Subject: Re: A natural magnet for the craziest TKinter lovers out there
*** Attention: This is an external email. Use caution responding, opening 
attachments or clicking on links. ***

On 1/18/23 18:01, Dan Kolis wrote:
> Hangs after maybe between 4 and 50 screen rewrites. sometimes CTRL C under 
> Ubuntu starts it up again. Click go rewrites al the fonts the thing can find 
> in a few windows Repeated.
>

Not sure what you mean by "screen rewrites."

I ran your test program here and it generates 25 windows on my machine,
and I can click "run" at least half a dozen times. I tried closing the
font windows before clicking run again, and also just leaving the
windows up and generating many more windows.  300 windows. No hangs here
at all. Fedora 35 with Mate Desktop on X11 with compositing enabled.

--
https://urldefense.com/v3/__https://mail.python.org/mailman/listinfo/python-list__;!!Cn_UX_p3!iGQaGdd9t2QPVQJDhyDTQmXgCwx4YG7m8jFbRd11dF1BweJHCd0wC4UyZUfQGQjqxeulMYagnDqInfA81A$<https://urldefense.com/v3/__https:/mail.python.org/mailman/listinfo/python-list__;!!Cn_UX_p3!iGQaGdd9t2QPVQJDhyDTQmXgCwx4YG7m8jFbRd11dF1BweJHCd0wC4UyZUfQGQjqxeulMYagnDqInfA81A$>
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: A natural magnet for the craziest TKinter lovers out there

2023-01-18 Thread Thomas Passin

On 1/18/2023 11:46 PM, Thomas Passin wrote:

On 1/18/2023 8:56 PM, Michael Torrie wrote:

On 1/18/23 18:01, Dan Kolis wrote:
Hangs after maybe between 4 and 50 screen rewrites. sometimes CTRL C 
under Ubuntu starts it up again. Click go rewrites al the fonts the 
thing can find in a few windows Repeated.




Not sure what you mean by "screen rewrites."

I ran your test program here and it generates 25 windows on my machine,
and I can click "run" at least half a dozen times. I tried closing the
font windows before clicking run again, and also just leaving the
windows up and generating many more windows.  300 windows. No hangs here
at all. Fedora 35 with Mate Desktop on X11 with compositing enabled.


It could be using up some system resource.  tk could have some memory or 
resource leak, possibly specific to the OP's machine.  Try looking at 
system memory with the system monitor as the program goes through its 
paces.  Maybe you will notice something suspicious.




Also reduce the number of windows that get opened to a small number.  If 
there are no freezes, increase the number little by little.  This may 
give you some bounds on what's going on, or at least let your ultimate 
program work by keeping the resource use under control.


--
https://mail.python.org/mailman/listinfo/python-list


Re: A natural magnet for the craziest TKinter lovers out there

2023-01-18 Thread Thomas Passin

On 1/18/2023 8:56 PM, Michael Torrie wrote:

On 1/18/23 18:01, Dan Kolis wrote:

Hangs after maybe between 4 and 50 screen rewrites. sometimes CTRL C under 
Ubuntu starts it up again. Click go rewrites al the fonts the thing can find in 
a few windows Repeated.



Not sure what you mean by "screen rewrites."

I ran your test program here and it generates 25 windows on my machine,
and I can click "run" at least half a dozen times. I tried closing the
font windows before clicking run again, and also just leaving the
windows up and generating many more windows.  300 windows. No hangs here
at all. Fedora 35 with Mate Desktop on X11 with compositing enabled.


It could be using up some system resource.  tk could have some memory or 
resource leak, possibly specific to the OP's machine.  Try looking at 
system memory with the system monitor as the program goes through its 
paces.  Maybe you will notice something suspicious.


--
https://mail.python.org/mailman/listinfo/python-list


Re: A natural magnet for the craziest TKinter lovers out there

2023-01-18 Thread Michael Torrie
On 1/18/23 18:01, Dan Kolis wrote:
> Hangs after maybe between 4 and 50 screen rewrites. sometimes CTRL C under 
> Ubuntu starts it up again. Click go rewrites al the fonts the thing can find 
> in a few windows Repeated.
> 

Not sure what you mean by "screen rewrites."

I ran your test program here and it generates 25 windows on my machine,
and I can click "run" at least half a dozen times. I tried closing the
font windows before clicking run again, and also just leaving the
windows up and generating many more windows.  300 windows. No hangs here
at all. Fedora 35 with Mate Desktop on X11 with compositing enabled.

-- 
https://mail.python.org/mailman/listinfo/python-list


A natural magnet for the craziest TKinter lovers out there

2023-01-18 Thread Dan Kolis
Hangs after maybe between 4 and 50 screen rewrites. sometimes CTRL C under 
Ubuntu starts it up again. Click go rewrites al the fonts the thing can find in 
a few windows Repeated.

TKinter has a cult following. I don''t really expect others to fix my problems, 
but you know, es since its a cult thing to love TCL ( or something  ) Here 
is is.

 Same on two different computers in Python 3.6 and 3.8

Plus I suppose you get to see for sure all your finest fonts as rendered in a 
real TK thing, not that this changes the worlds so much.


Thanks for the advice so far...
Regards,
Dan Kolis

# Code version 18Jan2023 19:48 EST Dan Kolis
# Click 'go' on main page. when run over and over after a while it freezes


import tkinter as   tk
from tkinter import ttk
from tkinter import fontas  luFont


# Empty object maker ( M T ) ... get it say it !
class MT():
pass


# Module level variables
mod = MT()
mod.itsPlaces = MT()
mod.itsPlaces = []


# Apply XY Size to things like windows, variable place 31Jul22
def apply_Width_Height_Position( toThis, aWidth, aHeight, *argsPlace ):

# Width and height is expected

# Argument overflow is quite variable size is it its usual hint for me
aLen = len( argsPlace )

# Sometimes, just width and height are given ( not that + position )
wAndH = str( int( aWidth ) ) +'x' + str( int( aHeight ) )   
# Size has a funny text line interface
toThis.geometry( wAndH )
# Apply

# Sometimes position too
if aLen == 2:
eP = "+" + str( argsPlace[ 0 ] ) + "+" +  str( argsPlace[ 1 ] )
param4 = wAndH + eP 
# Combine size and position
toThis.geometry( param4 )   
# Apply

jj = 560


# Create local   toplevel   to whoever calls me 11Dec22 bc-endive
def make_Tk_Window( sReason, *attribKc ):

# Top level window maker and rememberer
# Kc = 'Kind code'

aCode = "na"
# Not available
if attribKc:
aCode = attribKc [ 0 ]  
# Better code then 'na'

# Make window
ansWin = tk.Toplevel()

# Keep track of this creation step
newEntry = {}
newEntry[ 'tkaddress' ] = ansWin
# Real TK window accessor
newEntry[ 'ideanamed' ] = sReason   
# Casual description
newEntry[ 'kindcode'  ] = aCode 
# So can be worked with together

mod.itsPlaces.append( newEntry )

return ansWin


# Idle time rewrite
def justRedisplayNow( wThings,  *argsR ):

# Redisplay a named tj thing
# Dont use this frivolously, if it's needed its here you have to study it

wThings.update()  


# Look at fonts possible 6Oct22
def showAllFonts():

# Show fonts possible

mod.lines_In_Window = 30; mod.window_Seq_Number = 1

# What we want to see
mod.seeFonts = list( luFont.families() )
mod.seeFonts.sort() 
# Alpha order is nice

# Fill windows as a look at me report
try:
populateW()
except:
tt = 456

rr = 245


# Show fonts regarding avoiding BAD ones that crash, etc size limits in buffers 
too 19Dec22
def populateW():

# Put in the fonts

aLen = len( mod.seeFonts )  
# Fun to know, debug really
last_considered_name = "gghfjhljfl" 
# Don't show doubles

# Loop through all fonts the system named
thisPassMakeWindow = True; a_Line_Count = 0; list_Number = 0
for item in mod.seeFonts:

# Multiple windows ( Python has funny ideas on this, ok like this )
if thisPassMakeWindow:
winTk_Now = winMakerFontsW(); thisPassMakeWindow = False; 
a_Line_Count = 0  # We gots one now

if a_Line_Count < mod.lines_In_Window:  
 # Will a window we made
list_Number += 1
# Counts
aN = str( list_Number ) + " "; name_In_lower = item.lower()

# Various reasons to not render this one
isOk = True
if name_In_lower == last_considered_name:
isOk = False
a_Bad_Thing = name_In_lower.find( 'emoji' ) > -1
if a_Bad_Thing:
isOk = False
a_Bad_Thing = item.find( 'Noto Sans Mono CJK' ) > -1
if a_Bad_Thing:
isOk = False

# Good good
if isOk:
label = "listlabel" + str( list_Number )