Welcome to Software Development on Codidact!
Will you help us build our independent community of developers helping developers? We're small and trying to grow. We welcome questions about all aspects of software development, from design to code to QA and more. Got questions? Got answers? Got code you'd like someone to review? Please join us.
Activity for Karl Knechtelâ€
Type | On... | Excerpt | Status | Date |
---|---|---|---|---|
Comment | Post #289584 |
"Would this be correct?" - Generally I don't think that this sort of thing forms the basis of a useful question for a Q&A site. Did you **try** the code? Does it give the results you expect? Does anything strange happen? It would be better to identify a concrete problem, if any, to ask about; otherwi... (more) |
— | about 1 year ago |
Comment | Post #289575 |
While generally I agree that *whereas pipx answers the question "As a user, how can I conveniently install a tool which is available via PyPi, without learning anything about Python* is an accurate summary of the intended use case - Pipx has the issue that it expects you to have Python and Pip alread... (more) |
— | about 1 year ago |
Comment | Post #289573 |
OP seems to have clearly intended that the Python program should exit after scheduling the next task, but this is a useful technique for other situations. Actually, I was hoping to prepare a more general Q&A for language-agnostic techniques for this kind of scheduling. (more) |
— | about 1 year ago |
Comment | Post #289514 |
I agree wholeheartedly, so I edited that in - even though it's unnecessary for the example as you say. After all, I could *also* have just written the separate list elements explicitly; but the point is to show a more general technique. (more) |
— | about 1 year ago |
Edit | Post #289514 |
Post edited: use shlex.split per trichoplax's suggestion |
— | about 1 year ago |
Comment | Post #289563 |
I see that you address the following to some extent in the "Encoding" section of the answer, but I think it could use some elaboration.
My understanding is that Posix indeed allows filenames to contain arbitrary byte sequences aside from the 0x00 NUL byte and the path separator (0x2f byte). It's a... (more) |
— | about 1 year ago |
Edit | Post #289568 | Initial revision | — | about 1 year ago |
Answer | — |
A: How should I organize material about text encoding in Python into questions? Here is my current thinking on the matter. 1. Regarding questions/facets that are "two sides of the same coin" - encoding vs decoding the data, reading vs. writing files - I think they should be addressed in one breath. 1. Regarding the Python documentation: I think it is better cited, on deman... (more) |
— | about 1 year ago |
Edit | Post #289559 | Initial revision | — | about 1 year ago |
Question | — |
How should I organize material about text encoding in Python into questions? I want to write one or more self-answered Q&As on the topic of text encoding in Python, to serve as canonicals and preempt future lower-quality questions. I can think of the following things that need to be addressed: What is an encoding? What are encoding (the process) and decoding? How do I k... (more) |
— | about 1 year ago |
Comment | Post #289514 |
I don't know anything about `systemd-run`, actually. My first thought was `cron`, but that's intended for regularly re-occurring tasks. When I tried to do research on that, `at` came up. (more) |
— | about 1 year ago |
Edit | Post #289514 |
Post edited: |
— | about 1 year ago |
Edit | Post #289514 | Initial revision | — | about 1 year ago |
Answer | — |
A: How can I schedule a later task in Python? Use `at` to schedule the command, using `subprocess` from Python to invoke `at`. It doesn't even require `shell=True`. For example: ``` import shlex, subprocess subprocess.run( # `at` command to run now shlex.split("at now +10 minutes"), # shell command that `at` will schedule, ... (more) |
— | about 1 year ago |
Comment | Post #289488 |
It's hard to address the part where you "also heard that its 2-argument function signature is flawed" because we do not know **where** you heard it, and therefore we cannot possibly know *what argument* was being presented. This doesn't add anything to the post as it stands; if there *is* a flaw, the... (more) |
— | about 1 year ago |
Edit | Post #289481 |
Post edited: mention specific point when the error-message improvement was added |
— | about 1 year ago |
Edit | Post #289481 |
Post edited: |
— | about 1 year ago |
Edit | Post #289481 | Initial revision | — | about 1 year ago |
Answer | — |
A: How can I properly type-hint methods in different files that would lead to circular imports? Import modules rather than names first to avoid a circular reference in the `import` statements; then use forward declarations, as before, to avoid a circular reference in the type annotations - like so: ``` process.py import helpers class Process: def dosomething(self, helper: "helper... (more) |
— | about 1 year ago |
Edit | Post #289386 |
Post edited: remove noise, fix formatting, add link for lesser-known third-party library, improve grammar |
— | over 1 year ago |
Comment | Post #289386 |
I couldn't understand the explanation of what you tried. For example "assign_coords is not an inplace operation" doesn't say what to try, it only describes a problem. If that was the title of a post on Stack Overflow, it's not useful to just show that; we should have the links as well. Aside from tha... (more) |
— | over 1 year ago |
Suggested Edit | Post #289386 |
Suggested edit: remove noise, fix formatting, add link for lesser-known third-party library, improve grammar (more) |
helpful | over 1 year ago |
Edit | Post #289346 |
Post edited: improve title: fix grammar, indicate the specific context |
— | over 1 year ago |
Suggested Edit | Post #289346 |
Suggested edit: improve title: fix grammar, indicate the specific context (more) |
helpful | over 1 year ago |
Comment | Post #289289 |
If the way it works inconveniences you, it shouldn't be hard to make a simple wrapper - checkout a target branch, run a normal merge command, then checkout the original branch again. [Since 2.22, the current branch name can be found with `git branch --show-current`](https://stackoverflow.com/question... (more) |
— | over 1 year ago |
Edit | Post #289299 | Initial revision | — | over 1 year ago |
Answer | — |
A: Why is git merge from rather than to? > I struggle to think of any use cases for merging from. Why was the merge command designed this way? The model here is that many developers on the same project are using branches to develop features independently; someone has to be in charge, and that is the person responsible for the `master` (r... (more) |
— | over 1 year ago |
Comment | Post #289275 |
It seems like you're looking for something that happens *after* `onbeforeunload`, not before. Wouldn't that just be... `onunload`? (more) |
— | over 1 year ago |
Edit | Post #289278 |
Post edited: |
— | over 1 year ago |
Edit | Post #289252 |
Post edited: organize chronologically; add references for when features were added; label sections with brief guidance (and edit details to avoid repetition) |
— | over 1 year ago |
Edit | Post #289252 |
Post edited: Avoid repeating the main examples within the details |
— | over 1 year ago |
Edit | Post #289252 |
Post edited: fix formatting typo; improve wording a bit more |
— | over 1 year ago |
Edit | Post #289252 |
Post edited: Consistently show errors from 3.11; improve section warnings |
— | over 1 year ago |
Edit | Post #289251 |
Post edited: fix error message as shown in contemporary versions; add note about how it looks in older versions |
— | over 1 year ago |
Edit | Post #289251 |
Post edited: edit example to match the changes in my answer (to shorten it and avoid line-wraps) |
— | over 1 year ago |
Edit | Post #289252 |
Post edited: fix wording (the Template example requires instantiating a library class, so not a one-liner) |
— | over 1 year ago |
Edit | Post #289252 |
Post edited: Oops, that wasn't quite short enough |
— | over 1 year ago |
Edit | Post #289252 |
Post edited: Shorten the main example to avoid ugly wrapping on summary headers |
— | over 1 year ago |
Edit | Post #289252 |
Post edited: Add warnings/advice to the top based on my old Stack Overflow answer https://stackoverflow.com/a/73658493; hide details for each approach with a direct code example; fix references `spam_cans` -> `count` in examples |
— | over 1 year ago |
Edit | Post #289278 |
Post edited: |
— | over 1 year ago |
Edit | Post #289278 | Initial revision | — | over 1 year ago |
Answer | — |
A: Do we want a wiki (or similar) alongside Q&A? I think the framing of this question (and the prior discussion) is wrong, and I think that conditions have evolved since it was originally asked - in particular, we can now see how articles have turned out for other communities. Rather than try to define "wiki" or consider ways to implement that stra... (more) |
— | over 1 year ago |
Edit | Post #289252 |
Post edited: Add inline-code formatting for details-section labels (refer: https://meta.codidact.com/posts/289271) |
— | over 1 year ago |
Edit | Post #289252 |
Post edited: Fix header for %-style formatting, including relevant doc link |
— | over 1 year ago |
Edit | Post #289252 |
Post edited: Even more detail, reorganization and polishing |
— | over 1 year ago |
Edit | Post #289252 |
Post edited: |
— | over 1 year ago |
Edit | Post #289252 |
Post edited: Rearrange some points to exploit the labelled-example format more consistently |
— | over 1 year ago |
Edit | Post #289252 |
Post edited: update and enhance information about f-string syntax limitations |
— | over 1 year ago |
Comment | Post #289251 |
Regarding research and "readily accessible" information, please see [this meta question](https://software.codidact.com/posts/284979), where I put quite a bit of effort into explaining my own stance, as well as [my thoughts on how to grow the community](https://software.codidact.com/posts/285035/28917... (more) |
— | over 1 year ago |
Edit | Post #289252 |
Post edited: |
— | over 1 year ago |