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.

Search

Advanced Search Options

To further refine your search, you can use additional qualifiers such as score:>0.5. For example, the search score:>=0.5 created:<1y grammar would return only posts mentioning "grammar" that have a score >= 0.5 and were created less than a year ago.

Further help with searching is available in the help center.

Quick hints: tag:tagname, user:xxx, "exact phrase", post_type:xxx, created:<N{d,w,mo,y}, score:>=0.5

Filters
123 posts
 
60%
+7 −4
Q&A Why can parentheses cause exceptions in Python when using for loops?

Using parentheses in Javascript is always needed when you want to create functions, if/else statements and for/while loops. But in Python it has a function that is called tuples. When using an if s...

1 answer  ·  posted 1y ago by Bennshinpoes‭  ·  edited 1y ago by trichoplax‭

Question python syntax-error
75%
+4 −0
Meta How are software recommendations handled?

How are software recommendations handled on https://software.codidact.com/ ? https://outdoors.codidact.com/ has a "gear recommendations" section, so it seems like Codidact is open to the idea. I s...

1 answer  ·  posted 1y ago by matthewsnyder‭  ·  last activity 1y ago by Lundin‭

Question discussion
42%
+1 −2
Q&A Program freezing in `post_comments_to_lemmy` function due to potential infinite loop

I'm experiencing an issue where my program appears to freeze when executing the post_comments_to_lemmy function. This function fetches comments from the GitHub API and posts them to a Lemmy instanc...

1 answer  ·  posted 1y ago by ShadowsRanger‭  ·  last activity 1y ago by __blackjack__‭

Question python
66%
+2 −0
Q&A "Move symbol" refactor for Python in Visual Studio Codium

Is there a way to add support for "move symbol" in Python code for VS Codium? PyCharm can do this, but I am looking for a VSC solution. PyLance can do this, but PyLance itself is closed source, a...

0 answers  ·  posted 1y ago by matthewsnyder‭  ·  edited 1y ago by matthewsnyder‭

71%
+3 −0
Q&A How to resolve the mypy error "Returning Any from function declared to return 'Dict[str, Any]'" in Python?

I have a function that loads JSON data and is declared to return a dictionary with string keys and values of any type (Dict[str, Any]). However, mypy is raising an error stating that I am returning...

1 answer  ·  posted 1y ago by ShadowsRanger‭  ·  last activity 1y ago by Moshi‭

Question python mypy
61%
+6 −3
Q&A Why are commas not needed for modulo string formatting when printing?

Suppose I have two variables that are called animal and age, and print them as a string in the console like so: animal = "giraffe" age = 25 print("A %s can live up to %d years" %(animal,age)) ...

3 answers  ·  posted 2y ago by Bennshinpoes‭  ·  edited 1y ago by Karl Knechtel‭

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‭

50%
+1 −1
Q&A 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 d...

0 answers  ·  posted 1y ago by matthewsnyder‭

66%
+4 −1
Q&A How to overwrite lines of STDOUT in Python?

print() normally adds text to STDOUT, it does not erase existing text. https://linux.codidact.com/posts/289869 describes various ways of doing the overwrite in shell scripts. How can you do this ...

2 answers  ·  posted 1y ago by matthewsnyder‭  ·  last activity 1y ago by hkotsubo‭

Question python-3
33%
+0 −2
Q&A module not found error, I need this speech directory for this project to work. [closed]

--- Here is the error message. Traceback (most recent call last): File "c:\Users\19185\Documents\GitHub\Chatty\Chatty\one_.py", line 3, in import azure.cognitiveservices.speech as speechsdk Mo...

0 answers  ·  posted 11mo ago by KunningFox‭  ·  closed 11mo ago by Alexei‭

Question python-3
75%
+4 −0
Q&A How to troubleshoot ModuleNotFoundError?

I ran some Python code and it crashed with ModuleNotFoundError. What is the general approach for dealing with these situations?

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

Question import python-3
77%
+5 −0
Q&A How can one import two classes with the same name in Java8?

Some development tools provide an error message when a user tries to import two things (classes, packages) with the same name. Some programming languages offer a syntax to import one of those thing...

2 answers  ·  posted 11mo ago by tarhalda‭  ·  last activity 8mo ago by Michael‭

Question java java-8
41%
+3 −5
Q&A Building a language model completely from scratch

What I would like to do I would like to try to build a language model 100% from scratch if possible, for a learning experience. That means no external libraries and no pre-curated datasets. It ...

1 answer  ·  posted 10mo ago by Julius H.‭  ·  last activity 10mo ago by matthewsnyder‭

60%
+1 −0
Meta Issue with the Monospace font [duplicate]

I was trying to ask a code review question but I have observed that it does not support the "Monospace font" for code excerpts properly. It is only considered partially and I see this particularly ...

1 answer  ·  posted 9mo ago by aditya98‭  ·  closed as duplicate 9mo ago by Alexei‭

80%
+6 −0
Q&A How and where does Python code start running? How can I control that?

Suppose I have some code in a file myscript.py like: def my_function(): print("Test") What steps do I need to take in order to make my_function run? That is to say: how do I get Python to ...

2 answers  ·  posted 8mo ago by Karl Knechtel‭  ·  last activity 6mo ago by Michael‭

71%
+3 −0
Q&A How to iterate over numpy array axes in array slicing?

In short, I want to access a multidimensional array, starting with an entry, say a 4D array called "new_array". new_array[0,1,2,3] and getting as an output the sliced arrays new_array[:,1,2,3],n...

1 answer  ·  posted 7mo ago by purplenanite‭  ·  last activity 7mo ago by r~~‭

Question python numpy
71%
+3 −0
Q&A How do I trim a sorted list in Python?

How do I trim a sorted list in Python, so that I only keep the elements greater than a certain value? For example, if I have this list: l = [1, 3, 5, 6, 7, 8] How can I efficiently get a list of...

3 answers  ·  posted 7mo ago by congusbongus‭  ·  last activity 7mo ago by mellen‭

Question python array search
71%
+3 −0
Q&A Regex to get text outside brackets

I am trying to capture the content outside square brackets in groups, using this regex: (.*)\[.*?\](.*) And it works perfectly for a simple string like this: testing_[_is_]_done This is the...

2 answers  ·  posted 6mo ago by TonyMontana‭  ·  last activity 22d ago by hkotsubo‭

Question regex python-3
71%
+3 −0
Q&A Recursive traversal of composite tree of mutable "trait objects"?

I'm working on a background service/daemon for an embedded device, in Rust. The daemon manages several hardware components and these are structured using the Composite design pattern. The composite...

2 answers  ·  posted 6mo ago by ghost-in-the-zsh‭  ·  last activity 2mo ago by ghost-in-the-zsh‭

Question rust
80%
+6 −0
Q&A Use cases for raising a 'NotImplementedError' in Python

What are some legitimate use cases for raising a NotImplementedError exception in Python? How can it help express a code author's intentions to aid code maintenance and/or further development of co...

3 answers  ·  posted 6mo ago by pfabri‭  ·  last activity 5mo ago by pfabri‭

Question python exception
71%
+3 −0
Meta Closing self-answered question due to not being clear enough

I have a hard time deciding if How to get conditional running cumulative sum based on current row and previous rows? should be closed or not. As mentioned in the comments, it was already flagged t...

3 answers  ·  posted 6mo ago by Alexei‭  ·  last activity 3mo ago by Lundin‭

60%
+1 −0
Q&A Can you have syntax highlighting for streaming text in Python?

Suppose you have a situation where text is coming 1 word at a time, and you want to quickly show it to the user. "Quickly" is not in the sense of a performance constraint, but rather we don't want ...

2 answers  ·  posted 5mo ago by matthewsnyder‭  ·  edited 5mo ago by matthewsnyder‭

66%
+2 −0
Q&A How to execute and find gradients of a tensorflow (1) graph object

I have an "tensorflow.python.framework.ops.Graph" object loaded from a .pb file. def load_pb(path_to_pb): with tf.compat.v1.gfile.GFile(path_to_pb, "rb") as f: graph_def = tf.compat....

0 answers  ·  posted 4mo ago by purplenanite‭