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...

Re: Improvement to imports, what is a better way ?

2023-01-18 Thread Cameron Simpson
On 18Jan2023 16:10, Dan Kolis wrote: I have written a very sizable and elaborate program that uses tKinter for X11 displays of genomics. Yet maybe 1 of 6 times it freezes, so I decided to extract the minimum that works perfectly and add back big pieces. It does it both running .pyc and in VSC

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 "sc

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

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 cul

Re: Improvement to imports, what is a better way ?

2023-01-18 Thread Dan Kolis
I have written a very sizable and elaborate program that uses tKinter for X11 displays of genomics. Yet maybe 1 of 6 times it freezes, so I decided to extract the minimum that works perfectly and add back big pieces. It does it both running .pyc and in VSCode. so even the most minor of odditie

Re: Improvement to imports, what is a better way ?

2023-01-18 Thread Dan Kolis
Thank you -- https://mail.python.org/mailman/listinfo/python-list

Re: Improvement to imports, what is a better way ?

2023-01-18 Thread Michael Torrie
On 1/18/23 14:42, Dan Kolis wrote: > >> I don't think you've described this. I don't know what you mean here. > > When I trace it in VSCode the imports seem like they endlessly suspend > scanning and go to other ones over and over. Like "Whats this doing ?" > Nothing to worry about there. Pyt

Re: Improvement to imports, what is a better way ?

2023-01-18 Thread Greg Ewing
On 19/01/23 10:40 am, Dan Kolis wrote: I guess I don't full understand what bothers me about the repetition of the imports so much. It's doubtful that every module uses every one of those imports. It looks like someone had a standard block of imports that they blindly pasted at the top of ever

Re: Improvement to imports, what is a better way ?

2023-01-18 Thread Dan Kolis
> I don't think you've described this. I don't know what you mean here. When I trace it in VSCode the imports seem like they endlessly suspend scanning and go to other ones over and over. Like "Whats this doing ?" -- https://mail.python.org/mailman/listinfo/python-list

Re: Improvement to imports, what is a better way ?

2023-01-18 Thread Dan Kolis
Most of the time the newbie I visualize adding a function copies and pastes maybe a screen of python and changes it a little, maybe 5% of the lines have a xx. code so they rarely have to understand it, thats not the part of the program there changing. Also, I suffered long and hard for extreme

Re: Improvement to imports, what is a better way ?

2023-01-18 Thread Cameron Simpson
On 18Jan2023 12:57, Dan Kolis wrote: I'm not sure what to do. Do either / both know if there is a way to make it parse each import list to bytecode in one shot ?? Python usually compiles files to bytecode and leaves those around as .pyc files to be used until the original source is modified.

Re: Improvement to imports, what is a better way ?

2023-01-18 Thread Paul Bryan
On Thu, 2023-01-19 at 09:47 +1300, dn via Python-list wrote: > The longer an identifier, the more it 'pushes' code over to the right > or  > to expand over multiple screen-lines. Some thoughts on this are > behind > PEP-008 philosophies, eg line-limit. I sympathize with this issue. I've pushed t

Re: Improvement to imports, what is a better way ?

2023-01-18 Thread Weatherby,Gerard
In the body of the code, if every time an external identifier is used it must be prefixed by a full 'path', the cognitive "burden" shifts from the aspect highlighted (above), to a reading-burden. As the fictional Jack McCoy ( https://en.wikipedia.org/wiki/Jack_McCoy) would say -- Objection: Assu

Re: Improvement to imports, what is a better way ?

2023-01-18 Thread Dan Kolis
dn and Mats, thanks for your advice. I'm not sure what to do. Do either / both know if there is a way to make it parse each import list to bytecode in one shot ?? The hop around read keeps making me worry it migth leave some memory leak or something. I dont know. Thanks though, both your di

Re: Improvement to imports, what is a better way ?

2023-01-18 Thread dn via Python-list
On 19/01/2023 08.56, Mats Wichmann wrote: On 1/18/23 12:29, Paul Bryan wrote: ... import os as    os import sys as   sys import importlib as importlib A general comment: there are some very common "import ... as" idioms (for example, i

Re: IDLE "Codepage" Switching?

2023-01-18 Thread Eryk Sun
On 1/17/23, Stephen Tucker wrote: > > 1. Can anybody explain the behaviour in IDLE (Python version 2.7.10) > reported below? (It seems that the way it renders a given sequence of bytes > depends on the sequence.) In 2.x, IDLE tries to decode a byte string via unicode() before writing to the Tk te

Re: Improvement to imports, what is a better way ?

2023-01-18 Thread Mats Wichmann
On 1/18/23 12:29, Paul Bryan wrote: I would suggest allowing each module to define its own imports, don't import what a module doesn't consume, keep them simple, avoid devising a common namespace for each, and let tools like isort/black work out how to order/express them in source files. Indeed

Re: Improvement to imports, what is a better way ?

2023-01-18 Thread Paul Bryan
I would suggest allowing each module to define its own imports, don't import what a module doesn't consume, keep them simple, avoid devising a common namespace for each, and let tools like isort/black work out how to order/express them in source files. On Wed, 2023-01-18 at 10:43 -0800, Dan Kolis

Improvement to imports, what is a better way ?

2023-01-18 Thread Dan Kolis
This program has lots of files and each is well segregated for a concept. the top of each as a heap of imports, all identical. Well the very top has some one of's import os asos import sys as sys import importlib as importlib import d

Re: IDLE "Codepage" Switching?

2023-01-18 Thread Peter J. Holzer
On 2023-01-18 11:05:24 -0500, Thomas Passin wrote: > On 1/18/2023 5:43 AM, Stephen Tucker wrote: > > Thanks for these responses. > > > > I was encouraged to read that I'm not the only one to find this all > > confusing. > > > > I have investigated a little further. > > > > 1. I produced the foll

Re: IDLE "Codepage" Switching?

2023-01-18 Thread Thomas Passin
On 1/18/2023 5:43 AM, Stephen Tucker wrote: Thanks for these responses. I was encouraged to read that I'm not the only one to find this all confusing. I have investigated a little further. 1. I produced the following IDLE log: mylongstr = "" for thisCP in range (1, 256): mylongstr += chr (t

Re: IDLE "Codepage" Switching?

2023-01-18 Thread Stephen Tucker
Thanks for these responses. I was encouraged to read that I'm not the only one to find this all confusing. I have investigated a little further. 1. I produced the following IDLE log: >>> mylongstr = "" >>> for thisCP in range (1, 256): mylongstr += chr (thisCP) + " " + str (ord (chr (thisCP)))

Re: IDLE "Codepage" Switching?

2023-01-18 Thread Peter J. Holzer
On 2023-01-17 22:58:53 -0500, Thomas Passin wrote: > On 1/17/2023 8:46 PM, rbowman wrote: > > On Tue, 17 Jan 2023 12:47:29 +, Stephen Tucker wrote: > > > 2. Does the IDLE in Python 3.x behave the same way? > > > > fwiw > > > > Python 3.10.6 (main, Nov 14 2022, 16:10:14) [GCC 11.3.0] on linux