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 matthewsnyderâ€
Type | On... | Excerpt | Status | Date |
---|---|---|---|---|
Question | — |
Is there a text version of pickle? Is there a Python serialization format that has capabilities similar to Pickle, but is text based? The problem I always have with pickle is that it's binary, so I can't manually view or edit the data. The standard library includes `json`, but that requires a tedious converting of types at read ... (more) |
— | over 1 year ago |
Comment | Post #289633 |
While this makes sense, it seems a bit strange.
1) Isn't it bad to use exceptions for flow control?
2) Wouldn't this be surprising to a user who expects that `Ctrl+C` will *terminate* the program? (more) |
— | over 1 year ago |
Edit | Post #289605 |
Post edited: |
— | over 1 year ago |
Comment | Post #289605 |
No, just checking between calls is enough. (more) |
— | over 1 year ago |
Edit | Post #289605 | Initial revision | — | over 1 year ago |
Question | — |
Listen for key events in a CLI app I have a Python program like this: ```python done = False while u and not done: i = u.pop() print(f"Processing {i}") dobigtask(i) finishup() ``` Since this takes a long time, the user might get tired of waiting. I want the program to also continually listen for a keystroke, s... (more) |
— | over 1 year ago |
Comment | Post #289588 |
Why don't you just try changing it and see if it runs slower? (more) |
— | over 1 year ago |
Edit | Post #289589 |
Post edited: |
— | over 1 year ago |
Edit | Post #289589 |
Post edited: |
— | over 1 year ago |
Edit | Post #289589 |
Post edited: |
— | over 1 year ago |
Edit | Post #289589 |
Post edited: |
— | over 1 year ago |
Comment | Post #289589 |
The two previous questions explain the issue in more detail, but I'm adding my own summary in the hopes that it will be useful to other readers. (more) |
— | over 1 year ago |
Edit | Post #289589 | Initial revision | — | over 1 year ago |
Answer | — |
A: What is the point of pipx? Dependency conflicts are the problem pipx aims to solve, in the context of installing CLI programs. When you install a Python package, by default pip will also install their dependent packages so that you don't get `ImportError`s when trying to use the package. These dependencies are explicitly co... (more) |
— | over 1 year ago |
Comment | Post #289575 |
Thank you! That actually does answer my question. (more) |
— | over 1 year ago |
Comment | Post #289575 |
First, it's more accurate to say that `pip` is for installing python *packages*. When you say "dependencies", that makes it sound as if it can't install "tools", when in fact it can install any package. I am not aware of pip being specced specifically as to exclude installing non-dependencies. This i... (more) |
— | over 1 year ago |
Edit | Post #289566 | Initial revision | — | over 1 year ago |
Answer | — |
A: How should I organize material about text encoding in Python into questions? Much of this is already covered in various sources like https://docs.python.org/3/howto/unicode.html. Although there are issues with relying on links, I figure official documentation is probably fair game. I would start with two types of question: "Where can I find detailed information about t... (more) |
— | over 1 year ago |
Comment | Post #289514 |
Didn't know about `at` - seems like what I was looking for. Is this better [than systemd-run](https://linux.codidact.com/posts/289510/289511#answer-289511)? (more) |
— | over 1 year ago |
Edit | Post #289509 | Initial revision | — | over 1 year ago |
Question | — |
How can a Python program send itself to the background? Is it possible for a Python program to send itself in the background? For example, on Linux you can do `nohup somecmd &` and any program will run in the background. Some programs also support switches like `-d` (daemonize) to run in the background without `nohup`/`&`. How can a Python program do t... (more) |
— | over 1 year ago |
Edit | Post #289508 | Initial revision | — | over 1 year ago |
Question | — |
How can I schedule a later task in Python? I want my CLI Python program to schedule a task, and then exit. After some times has passed (say 10 minutes) the task should execute. The task can be a Python method or a shell command, whatever is easier. I can convert my use case to accommodate it. This would be on Linux only. How can I sc... (more) |
— | over 1 year ago |
Edit | Post #289484 |
Post edited: |
— | over 1 year ago |
Edit | Post #289506 | Initial revision | — | over 1 year ago |
Answer | — |
A: Clone .git repo into current dir, without touching files One way to do it is to simply clone the repo elsewhere and move the .git file to the current one. (more) |
— | over 1 year ago |
Edit | Post #289505 | Initial revision | — | over 1 year ago |
Question | — |
Clone .git repo into current dir, without touching files I have git repo where the .git is deleted. I didn't realize it until after I made some changes to the code. I want to re-create the `.git` by cloning. However I don't want it to touch the files that I already have. When the `.git` is cloned, I will run git checkout and it will detect my changes as... (more) |
— | over 1 year ago |
Comment | Post #280700 |
This is a very transactional way to look at it. Taken to its logical conclusion, it implies there's no point contributing to open source at all.
I understand that some people choose to provide their work for free and resent the fact that they don't get more money out of it. Not all FOSS devs are l... (more) |
— | over 1 year ago |
Edit | Post #289486 | Initial revision | — | over 1 year ago |
Answer | — |
A: Git: How to clone only a few recent commits? This is called a shallow clone and it's supported by a git-clone argument: ``` git clone --depth 5 ``` (more) |
— | over 1 year ago |
Edit | Post #289484 | Initial revision | — | over 1 year ago |
Question | — |
Git: How to clone only a few recent commits? How do I clone the repository with only part of the history? For example, let's say I want to download only the last 5 commits out of thousands. (more) |
— | over 1 year ago |
Edit | Post #289445 |
Post edited: |
— | over 1 year ago |
Comment | Post #289443 |
I agree on that as well. "How pipx works" is interesting and useful, but it's not pertinent information. It should be in a separate post. (more) |
— | over 1 year ago |
Comment | Post #289443 |
This has some information but it seems a bit too biased in favor of pipx. The first three paragraphs don't add anything. There's some speculation about features that are not actually part of pipx. In the bulleted list, IMO 3, 4 and 6 are already things you get in pip. That said, there are some reason... (more) |
— | over 1 year ago |
Edit | Post #289445 | Initial revision | — | over 1 year ago |
Answer | — |
A: Is it wrong to demand features in open-source projects? "Demanding features" falls under an umbrella called "design". Design work doesn't show up directly in the commits (unless you maintain a design doc) but it is work nonetheless. Suggesting features is volunteer design work. In principle, the maintainer should welcome such work just as they would w... (more) |
— | over 1 year ago |
Comment | Post #289427 |
@#56342 But look what we get if we follow your logic: pip, pipx, apt, brew, cargo (and probably Julia, which I don't know) can all install packages in system locations. Then saying that "pipx is like apt or brew because it installs packages" makes no sense, because pip does that too. So why would you... (more) |
— | over 1 year ago |
Comment | Post #289427 |
@#53177 I was thinking of `apt` and `brew`, not `Nuget`. This is because the linked page calls them out as examples. AFAIK `nuget` is basically the pip of C#, which is probably why pipx docs don't use it as an example.
Anyways, I was hoping that the question does not require you to guess what I un... (more) |
— | over 1 year ago |
Edit | Post #289427 |
Post edited: |
— | over 1 year ago |
Edit | Post #289427 |
Post edited: |
— | over 1 year ago |
Edit | Post #289427 |
Post edited: |
— | over 1 year ago |
Edit | Post #289427 |
Post edited: |
— | over 1 year ago |
Edit | Post #289427 |
Post edited: |
— | over 1 year ago |
Edit | Post #289427 | Initial revision | — | over 1 year ago |
Question | — |
What is the point of pipx? Background - Many Python programs now recommend installing with pipx, and there is a sense that you shouldn't install with pip anymore, you should use tools like pipx. Main Question - However, what does pipx actually do that makes it such a preferred alternative to pip? Thoughts - I check... (more) |
— | over 1 year ago |
Edit | Post #289316 |
Post edited: |
— | over 1 year ago |
Edit | Post #289319 |
Post edited: |
— | over 1 year ago |
Comment | Post #289318 |
I will also accept answers with *original* terminology, on the condition that the terminology proposed is clear, well justified and the names are not particularly clumsy.
Caveat: If someone does produce an established terminology, such as something from a well known textbook, I may favor that over... (more) |
— | over 1 year ago |