Deutsch English Français Italiano |
<vaitf9$2k7o6$7@dont-email.me> View for Bookmarking (what is this?) Look up another Usenet article |
Path: ...!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: Lawrence D'Oliveiro <ldo@nz.invalid> Newsgroups: comp.lang.python Subject: Re: Triggered By Mediocre Code (Posting On Python-List Prohibited) Date: Mon, 26 Aug 2024 21:52:41 -0000 (UTC) Organization: A noiseless patient Spider Lines: 28 Message-ID: <vaitf9$2k7o6$7@dont-email.me> References: <vag94r$23hhf$2@dont-email.me> <878qwk9rym.fsf@nightsong.com> <vagfus$24uu6$5@dont-email.me> <87a5gz116b.fsf@nightsong.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Injection-Date: Mon, 26 Aug 2024 23:52:41 +0200 (CEST) Injection-Info: dont-email.me; posting-host="eec8a5f8880ec9ebcfea2c2354da2438"; logging-data="2760454"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19HL8qUEnWmsML7VxdSgWqo" User-Agent: Pan/0.160 (Toresk; ) Cancel-Lock: sha1:Gc0iz91QDSso6HPTHYzLtYXHpOE= Bytes: 2139 On Mon, 26 Aug 2024 13:25:48 -0700, Paul Rubin wrote: > Lawrence D'Oliveiro <ldo@nz.invalid> writes: > >> Printf style makes it explicit that it is an integer, and nothing else >> will do: >> >> bufferedNumber = "%0.4d" % doc.GetTime().GetFrame(docFps) > > bufferedNumber = f'{doc.GetTime().GetFrame(docFps):04d}' > > seems to handle it too. Note that “04d” is not quite the same as “0.4d”. > Regarding PHP, many shared hosting vendors offer it without offering > Python. It's easier with PHP to serve many customers with a single PHP > instantiation I’m sure they do. It’s typically offered via the “mod_php” module that executes within an Apache web server process. Turns out there is an interesting technical limitation of this, though: it doesn’t handle WebSockets very well. Python has ASGI, which offers your choice of Web frameworks founded on async/await and asyncio. Instead of running as an addon module in the Web server, the Python code runs in a separate process, with its own independent flow of control. This is much more versatile.