Re: Triggered By Mediocre Code (Posting On Python-List Prohibited)

Liste des GroupesRevenir à cl python 
Sujet : Re: Triggered By Mediocre Code (Posting On Python-List Prohibited)
De : ldo (at) *nospam* nz.invalid (Lawrence D'Oliveiro)
Groupes : comp.lang.python
Date : 26. Aug 2024, 00:49:48
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <vagfus$24uu6$5@dont-email.me>
References : 1 2
User-Agent : Pan/0.160 (Toresk; )
On Sun, 25 Aug 2024 15:07:45 -0700, Paul Rubin wrote:

Lawrence D'Oliveiro <ldo@nz.invalid> writes:
>
I mean, really? Four lines to do what could be done in a single
expression?  Was that written by a PHP programmer, do you think?
 
It is not fluent Python, that's for sure.  No idea about PHP though.  I
have been wondering about PHP recently.  The language is painful but the
implementation has some attractions and it's widely available.

I earn part of my living from it. It’s something I use when I have to
(e.g. writing WordPress plugins). I don’t know what these “attractions”
are that you speak of: Python is at least as widely available, and it does
better than PHP at Web-based programming (supposedly PHP’s bread and
butter) because ASGI-based frameworks allow common handling of WebSocket
connections together with regular HTTP ones, which is more awkward in PHP.

Is this what you had in mind?
 
    bufferedNumber = f'{doc.GetTime().GetFrame(docFps):04}'

Printf style makes it explicit that it is an integer, and nothing else
will do:

    bufferedNumber = "%0.4d" % doc.GetTime().GetFrame(docFps)

The irony of my putdown is that PHP can do it about as simply. But don’t
expect your typical PHP programmers to know that ...

Date Sujet#  Auteur
25 Aug 24 * Triggered By Mediocre Code (Posting On Python-List Prohibited)13Lawrence D'Oliveiro
26 Aug 24 +* Re: Triggered By Mediocre Code (Posting On Python-List Prohibited)11Paul Rubin
26 Aug 24 i`* Re: Triggered By Mediocre Code (Posting On Python-List Prohibited)10Lawrence D'Oliveiro
26 Aug 24 i +- Re: Triggered By Mediocre Code (Posting On Python-List Prohibited)1rbowman
26 Aug 24 i `* Re: Triggered By Mediocre Code (Posting On Python-List Prohibited)8Paul Rubin
26 Aug 24 i  `* Re: Triggered By Mediocre Code (Posting On Python-List Prohibited)7Lawrence D'Oliveiro
27 Aug 24 i   `* Re: Triggered By Mediocre Code (Posting On Python-List Prohibited)6Paul Rubin
27 Aug 24 i    `* Re: Triggered By Mediocre Code (Posting On Python-List Prohibited)5Lawrence D'Oliveiro
27 Aug 24 i     `* Re: Triggered By Mediocre Code (Posting On Python-List Prohibited)4Paul Rubin
28 Aug 24 i      `* Re: Triggered By Mediocre Code (Posting On Python-List Prohibited)3Lawrence D'Oliveiro
28 Aug 24 i       `* Re: Triggered By Mediocre Code (Posting On Python-List Prohibited)2Paul Rubin
28 Aug 24 i        `- Re: Triggered By Mediocre Code (Posting On Python-List Prohibited)1Lawrence D'Oliveiro
27 Aug 24 `- Re: Triggered By Mediocre Code (Posting On Python-List Prohibited)1Piergiorgio Sartor

Haut de la page

Les messages affichés proviennent d'usenet.

NewsPortal