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
109 posts
 
66%
+2 −0
Q&A Is it okay to use python operators for tensorflow tensors?

TL;DR Is (a and b) equivalent to tf.logical_and(a, b) in terms of optimization and performance? (a and b are tensorflow tensors) Details I use Python with Tensorflow. My priorities are Make t...

1 answer  ·  posted 10mo ago by daniel_s‭  ·  edited 10mo ago by meta user‭

60%
+1 −0
Q&A Command to format code from repo into single markdown file

I'm trying to flatten a repository of Python code into a Markdown file where each file is formatted like: relative/path/to/file1.py # contents of file1.py I'm using this command: find . -name...

2 answers  ·  posted 8mo ago by ShadowsRanger‭  ·  last activity 5mo ago by Michael‭

Question bash
60%
+1 −0
Q&A Why does `distutils` seem to be missing or broken? Isn't it part of the standard library?

Sometimes when I try to install a third-party library for Python, I get an error saying that either distutils, or some part of it like distutils.core or distutils.util, could not be found. It's sho...

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

77%
+5 −0
Q&A Reinstall old Python libraries after update

Recently, Python updated from 3.11 to 3.12 and now all my libraries are gone. Actually they're in the old 3.11 site-packages, but now that python points to 3.12 those are not active. Every time I r...

3 answers  ·  posted 30d ago by matthewsnyder‭  ·  last activity 15d ago by Karl Knechtel‭

Question python-3
66%
+2 −0
Q&A How can I access and use command-line arguments in Python?

In many other programming languages, the execution of code starts in a specifically named function (such as main) which is expected to have a specific signature, which allows that function to recei...

1 answer  ·  posted 15d ago by Karl Knechtel‭  ·  last activity 15d ago by Karl Knechtel‭

66%
+2 −0
Q&A How do I configure log4net from an arbitrary data structure?

I'm used to working in Python, but my current project is in C#/.NET and uses log4net for logging. Out of the box, log4net uses an XML file for configuration. I dislike XML and want to use something...

1 answer  ·  posted 3y ago by ajv‭  ·  last activity 3y ago by Peter Taylor‭

Question .net log4net
75%
+4 −0
Q&A Is it possible to write protocols for enumerations in Python?

Having recently learned about protocols in Python, I now wonder if you can write a protocol for enumerations. That is, a protocol that says that you are supposed to pass an enum that has certain it...

1 answer  ·  posted 2y ago by celtschk‭  ·  last activity 2y ago by r~~‭

75%
+4 −0
Code Reviews A state machine in Python

I've written the following code implementing a state machine in Python, and I'd like some feedback on it. The basic idea is that each state has a set of corresponding actions that trigger a state ...

2 answers  ·  posted 2y ago by celtschk‭  ·  last activity 2y ago by Nick Alexeev‭

77%
+5 −0
Q&A 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 i...

3 answers  ·  posted 10mo ago by matthewsnyder‭  ·  last activity 10mo ago by H_H‭

77%
+5 −0
Q&A How is this code "dividing" by a string?

I found a strange expression in some Python code: from library import HOME_DIRECTORY file = HOME_DIRECTORY / "file.json" It seems to be dividing a string by another string in order to do som...

3 answers  ·  posted 25d ago by Andrew Ray‭  ·  edited 23d ago by hkotsubo‭

60%
+1 −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 16d ago by Karl Knechtel‭  ·  last activity 16d ago by Karl Knechtel‭

66%
+2 −0
Q&A Understanding the `if __name__ == '__main__':` idiom

I've seen many examples of Python scripts that include a line that says: if __name__ == '__main__': Sometimes the following block contains a bunch of code, but other times it just makes a singl...

1 answer  ·  posted 15d ago by Karl Knechtel‭  ·  last activity 15d ago by Karl Knechtel‭

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

I understand the benefits of virtual environments in general, and specifically I want to use a virtual environment so that I'll have access to Pip without exposing the system Python (i.e., included...

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

66%
+2 −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 12d ago by Karl Knechtel‭  ·  last activity 12d ago by Karl Knechtel‭

50%
+0 −0
Q&A How to make Box drive have the files prepared for access when I need it?

I have Box drive on Windows. I use it as a regular folder on the computer. I can store images there. When I store a small number of images (on the order of a couple hundreds) and I do not wait lon...

0 answers  ·  posted 6d ago by Ivan Nepomnyashchikh‭  ·  edited 5d ago by trichoplax‭

71%
+3 −0
Q&A Keras model evaluate returns triggered tf.function retracing warning

I am training the following model using Keras as shown: model = tf.keras.models.Sequential([tf.keras.layers.Conv2D(64, (3,3), activation='relu', input_shape=(256, 256, 3)), tf.keras.layers.MaxPooli...

0 answers  ·  posted 3y ago by Guilherme Costa‭

Question keras tensorflow
64%
+9 −4
Q&A Is omitting braces for single statements bad practice?

Consider this code: while(arr[index] != 0) index++; vs while(arr[index] != 0) { index++; } Personally, I prefer the first. The fact that the braces are not needed makes them -- u...

6 answers  ·  posted 3y ago by klutt‭  ·  last activity 10mo ago by H_H‭

70%
+5 −1
Q&A Where did my proper divisor sum program went wrong?

Here in Python, I created a program for this challenge and I'm having trouble debugging it. I already fixed most errors I have on my program but here's what I have left: x=y=z=[];i=0.0;a=int(input...

1 answer  ·  posted 3y ago by General Sebast1an‭  ·  last activity 3y ago by hkotsubo‭

Question python debugging
40%
+0 −1
Q&A How to initialize variable assignment in a non-OOP interpreter?

I'm still in the process of making MarkFuncs and having given up from copy-pasting open-source interpreters, them using OOP too, I decided to make one without OOP and with scratch alongside with th...

1 answer  ·  posted 3y ago by General Sebast1an‭  ·  last activity 3y ago by Canina‭

42%
+1 −2
Q&A Objection CLI - SVM Conception - Freezing prompt

Now I build a Python script to execute automaticaly a dynamic analysis on apk and I block because I use this library and call objection. When I run my script, the objection command creates an inst...

0 answers  ·  posted 2y ago by Link213‭  ·  edited 2y ago by Alexei‭

60%
+4 −2
Q&A Separate digits of a number in groups with different sizes

I have a list of 11-digit numbers stored in one single column in Excel, and I need to separate the digits according to this pattern: 2-2-1-3-3. Example: 00002451018 becomes 00 00 2 451 018. How c...

2 answers  ·  posted 2y ago by sfrow‭  ·  edited 2y ago by Alexei‭

62%
+3 −1
Q&A Python looping 300 000 rows

Based on my last question comes new one. How to loop over 300 000 rows and edit each row string one by one? I have a list of 11-digit numbers stored in one single column in Excel, and I need to s...

1 answer  ·  posted 2y ago by sfrow‭  ·  last activity 2y ago by NoahTheDuke‭

77%
+5 −0
Q&A What is the Python Global Interpreter Lock?

What exactly is the Python Global Interpreter Lock (GIL)? As someone who is relatively new to Python, is this something I need to be aware of, or is this just some implementation detail of the inte...

1 answer  ·  posted 2y ago by Moshi‭  ·  last activity 2y ago by Derek Elkins‭

Question python python-gil
45%
+3 −4
Q&A Create a list of Niven numbers in Python

There's this new challenge on Code Golf CD and I'm using Python to do it. A little bit of golfing already took place, so the code might look a bit messy for you. Anyway, I'm proud of what I've writ...

2 answers  ·  posted 2y ago by General Sebast1an‭  ·  last activity 2y ago by Dirk Herrmann‭

Question python function
75%
+4 −0
Q&A What's causing mypy to give an `[assignment]` error in this nested for loop?

I started adding types to my (working) solution to Exercism's "Kindergarten Garden" exercise, to learn how typing with python and Mypy (strict) works. While doing so, I ran into a Mypy error that I...

2 answers  ·  posted 1y ago by true_blue‭  ·  last activity 1y ago by Moshi‭

Question python mypy