Communities

Writing
Writing
Codidact Meta
Codidact Meta
The Great Outdoors
The Great Outdoors
Photography & Video
Photography & Video
Scientific Speculation
Scientific Speculation
Cooking
Cooking
Electrical Engineering
Electrical Engineering
Judaism
Judaism
Languages & Linguistics
Languages & Linguistics
Software Development
Software Development
Mathematics
Mathematics
Christianity
Christianity
Code Golf
Code Golf
Music
Music
Physics
Physics
Linux Systems
Linux Systems
Power Users
Power Users
Tabletop RPGs
Tabletop RPGs
Community Proposals
Community Proposals
tag:snake search within a tag
answers:0 unanswered questions
user:xxxx search by author id
score:0.5 posts with 0.5+ score
"snake oil" exact phrase
votes:4 posts with 4+ votes
created:<1w created < 1 week ago
post_type:xxxx type of post
Search help
Notifications
Mark all as read See all your notifications »

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.

Posts by Karl Knechtel‭

99 posts
75%
+4 −0
Meta Questions easily answered by studying a beginner-level book

There's still time This scenario is not yet a problem for this site, but we will get there, since it's a huge problem for Stack Overflow This topic should be separately addressed, too. At ti...

posted 2y ago by Karl Knechtel‭

Answer
75%
+4 −0
Meta Should self-answered Q&A use separate answers for different techniques/approaches (even if there's a caveat that applies overall)?

Looking back at my own Q&A How can I build a string from smaller pieces?, the answer is incredibly long. I'm essentially showing five different ways to solve the problem - because they all exis...

2 answers  ·  posted 1y ago by Karl Knechtel‭  ·  last activity 1y ago by Lundin‭

Question discussion answers self-answered-questions
75%
+4 −0
Q&A Understanding mutable default arguments in Python

Workarounds Avoiding mutation Because problems are only caused by actually mutating the default argument, the simplest way to avoid problems is to... not do that. Pythonic code obeys command-quer...

posted 1y ago by Karl Knechtel‭  ·  edited 1y ago by Karl Knechtel‭

Answer
75%
+4 −0
Q&A Understanding "logical OR" and "logical AND" in programming languages

Many programming languages either have keywords like or and and used for logic, or equivalent operators such as || or && - which are referred to as "logical or" and "logical and" respective...

3 answers  ·  posted 7mo ago by Karl Knechtel‭  ·  edited 6mo ago by Andreas demands justice for humanity‭

Question language-agnostic language-design logic
75%
+4 −0
Meta Comparing our site scope to Stack Overflow

We've had discussions before about the site's intended scope (range of permissible topics and questions), but for new users coming from the Stack Exchange network, I think it would be useful to dra...

2 answers  ·  posted 7mo ago by Karl Knechtel‭  ·  last activity 7mo ago by Lundin‭

Question discussion scope stack-overflow
75%
+4 −0
Meta Should beginner-oriented Q&A here include basic use of a terminal (command line) for developers?

It seems that year over year, computers constantly get easier to use, and it becomes easier for people to start learning to program who have never touched it before. This comes with the consequence...

3 answers  ·  posted 11mo ago by Karl Knechtel‭  ·  last activity 11mo ago by matthewsnyder‭

Question discussion scope beginner-questions
71%
+3 −0
Meta How can we grow this community?

Cite good Q&A elsewhere For example: I was saddened to realize that, as of me writing this, a question and/or answer from Software Development has never been submitted on Hacker News. The doma...

posted 2mo ago by Karl Knechtel‭

Answer
71%
+3 −0
Q&A Automatically install all packages needed

A compromise exists between automatically inferring package names (unreliable and potentially dangerous) and writing out an explicit separate requirements.txt file: script-running tools such as pip...

posted 2y ago by Karl Knechtel‭  ·  edited 2y ago by Karl Knechtel‭

Answer
71%
+3 −0
Meta A milestone for Software Development - congratulations!

It seems fine to me to restrict new users in this way - most of them probably weren't getting anywhere near the old limits, or even the new ones, anyway. (It's unfortunately common on sites like th...

posted 4mo ago by Karl Knechtel‭

Answer
71%
+3 −0
Meta Do we want MathJax?

I would support this, but only if it doesn't noticeably distract from implementing other important features. I imagine that MathJax would have a real, but niche use on Software for more theoretical...

posted 4mo ago by Karl Knechtel‭

Answer
71%
+3 −0
Q&A Simultaneous comparison in Python

Using and and or correctly The left-hand side and right-hand side of these operators should both be valid operands, which should each come from a comparison. Thus, we should repeat the comparison ...

posted 7mo ago by Karl Knechtel‭

Answer
71%
+3 −0
Q&A Understanding "de Morgan's laws"

Overview de Morgan's laws are rules of logic that allow you to transform one conditional expression into another, equivalent expression. Because (in Boolean logic) two negations cancel each other ...

posted 7mo ago by Karl Knechtel‭  ·  edited 7mo ago by Karl Knechtel‭

Answer
71%
+3 −0
Q&A Understanding "de Morgan's laws"

While trying to understand logical 'or'/'and', I encountered another problem (I'm writing Python code here, but my question is about the logic, not about any given programming language). I have som...

1 answer  ·  posted 7mo ago by Karl Knechtel‭  ·  last activity 7mo ago by Karl Knechtel‭

Question language-agnostic logic
71%
+3 −0
Q&A What happened, or is happening, to other parts of the standard library? Why are they going missing?

In Python 3.12, I noticed that some libraries seem to be missing or "deprecated": >>> import asynchat Traceback (most recent call last): File "<stdin>", line 1, in <module&gt...

1 answer  ·  posted 12mo ago by Karl Knechtel‭  ·  last activity 12mo ago by Karl Knechtel‭

Question python standard-library
71%
+3 −0
Q&A Why does `tkinter` (or `turtle`, or IDLE) seem to be missing or broken? Isn't it part of the standard library?

General This question and answer are adapted from my original write-up on Stack Overflow, which you may consult for more details. This version is crafted as to be a clear overview, without referri...

posted 12mo ago by Karl Knechtel‭  ·  edited 11mo ago by Karl Knechtel‭

Answer
71%
+3 −0
Q&A Why does `pip` seem to be missing or broken? Isn't it part of the standard library?

Contrary to popular belief, Pip is not part of the Python standard library - although it comes as part of a standard distribution of Python. Pip is developed and maintained by the arms-length Pytho...

posted 12mo ago by Karl Knechtel‭  ·  edited 12mo ago by Karl Knechtel‭

Answer
71%
+3 −0
Q&A Understanding Virtual Environments for Python

Several times now, I've seen advice in tutorials, setup/install instructions for Python-based projects, etc. to use a virtual environment to keep things organized and make it simpler to manage the ...

1 answer  ·  posted 12mo ago by Karl Knechtel‭  ·  last activity 12mo ago by Karl Knechtel‭

Question python runtime-environment python-venv
71%
+3 −0
Q&A How can I start my Python code, from the code itself?

I have already learned how to tell the Python interpreter to run my code, but the standard approach feels a little unsatisfactory. I want the user experience to be that my program starts with the a...

1 answer  ·  posted 12mo ago by Karl Knechtel‭  ·  last activity 11mo ago by Karl Knechtel‭

Question python startup
71%
+3 −0
Q&A Choosing between multiple Python installations (environments) on the same computer

This answer assumes only installations of the reference "CPython" implementation, as provided by the official website at https://www.python.org. Other installations - such as those provided by th...

posted 1y ago by Karl Knechtel‭  ·  edited 1y ago by Karl Knechtel‭

Answer
71%
+3 −0
Q&A Choosing between multiple Python installations (environments) on the same computer

I have multiple installations of Python on my machine. When I run Python, what determines which installation is used? How can I control this?

1 answer  ·  posted 1y ago by Karl Knechtel‭  ·  edited 12mo ago by Karl Knechtel‭

Question python installation runtime-environment
71%
+3 −0
Q&A Privilege escalation from Python like from systemd

Generallly (assuming no exploit is found) it's not possible to escalate the privileges of an already running process, except via code that itself has kernel level access (running in ring 0 - this i...

posted 1y ago by Karl Knechtel‭  ·  edited 1y ago by Karl Knechtel‭

Answer
71%
+3 −0
Q&A How can I manage multiple consecutive strings in a buffer (and add more later)?

The fundamental problem here is that it is already ambiguous where the "end" of the data in the buffer is. Strings can be empty (have zero length as reported by strlen); as such, buffer could equal...

posted 1y ago by Karl Knechtel‭

Answer
71%
+3 −0
Q&A Open file in script's own folder

Theory Relative paths are relative to the current working directory of the Python process. This can be checked from within Python using the os.getcwd function and set using the os.chdir function. ...

posted 1y ago by Karl Knechtel‭

Answer
71%
+3 −0
Meta Handling common wrong approaches and misguided motivations for basic technique questions

Background This is inspired to some extent by https://software.codidact.com/posts/289597 . I'm trying to provide a large amount of content (gradually!) that novices (mainly to Python) will find u...

1 answer  ·  posted 1y ago by Karl Knechtel‭  ·  last activity 1y ago by Lundin‭

Question discussion answers canonicals xy-problem
71%
+3 −0
Q&A How can I output / display multiple values, with controlled spacing, without building a string?

I know that I can display a single string in the terminal window like print("example") (or similarly with a string in a variable), and I know how to open text files and write to them. I also know ...

1 answer  ·  posted 2y ago by Karl Knechtel‭  ·  last activity 2y ago by Karl Knechtel‭

Question python format output