My thoughts is that if the "many lines of code" puts the except to far
from the try, then perhaps it would have made sense to factor out some
part there into a function.
Perhaps like:
try:
with open(FileName) as f:
for ln in f{
process(ln)
except FileNotFoundError:
print(f"F
> On Apr 29, 2024, at 12:23 PM, jak via Python-list
> wrote:
>
> Hi everyone,
> one thing that I do not understand is happening to me: I have some text
> files with different characteristics, among these there are that they
> have an UTF_32_le coding, utf_32be, utf_16_le, utf_16_be all of them
On 2/6/24 10:46 PM, Jim via Python-list wrote:
Friends,
Please forgive me if this is not the proper forum for dealing with an issue of mine, but
I am at a loss in finding a fix for a python problem in the program ClipGrab. The program
allows one to download videos or audios from YouTube and oth
On 12/28/2023 12:20 AM EST rbowman via Python-list
<[1]python-list@python.org> wrote:
On Wed, 27 Dec 2023 03:53:42 -0600, Greg Walters wrote:
The biggest caveat is that the shared variable MUST exist before it
can
be examined or used (not surprising).
Read the Fine context manager documentation.
What “with with_expression as var” does is effectively:
ob = with_expression
var = ob.__enter__()
And then at the end of the with, does a
ob.__exit__()
(With some parameters to __exit__, that could just be None, None, None for the
simplest case).
N
Read the Fine context manager documentation.
What “with with_expression as var” does is effectively:
ob = with_expression
var = ob.__enter__()
And then at the end of the with, does a
ob.__exit__()
(With some parameters to __exit__, that could just be None, None, None for the
simplest case).
N
My view of the issue is that the "trick" of "evaluating" a name to see
if the object has been initialized is just a tad on the "tricky" side,
and the annotation/value is really incorrect.
The name at the point you are annotating it, isn't really a "bool"
because a bool will always have either
> On Aug 17, 2023, at 10:02 AM, c.buhtz--- via Python-list
> wrote:
>
> X-Post: https://stackoverflow.com/q/76913082/4865723
>
> I want to display one string in its original source (untranslated) version
> and in its translated version site by site without duplicating the string in
> the pyt
On 7/3/23 1:38 PM, Peter Slížik via Python-list wrote:
Hello.
The legacy code I'm working with uses a classic diamond inheritance. Let me
call the classes *Top*, *Left*, *Right*, and *Bottom*.
This is a trivial textbook example. The classes were written in the
pre-super() era, so all of them ini