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
 
77%
+5 −0
Q&A How can I properly type-hint methods in different files that would lead to circular imports?

I am writing a Python package where I have two classes in different files that (indirectly) depend on each other. If I wouldn't care about type-hints, there would be no problem, but unfortunately,...

2 answers  ·  posted 1y ago by mr Tsjolder‭  ·  edited 1y ago by Alexei‭

50%
+0 −0
Q&A Best practices to write functions for both execution modes in Tensorflow, eager and graph mode

I regularly run into the problem that I have a Python function that I want to use in both, eager and graph execution mode. I therefore have to adjust the code so that it can handle both situations....

1 answer  ·  posted 1y ago by daniel_s‭  ·  edited 1y ago by daniel_s‭

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 1y ago by daniel_s‭  ·  edited 1y 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 1y ago by ShadowsRanger‭  ·  last activity 11mo 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 8mo ago by Karl Knechtel‭  ·  last activity 8mo 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 7mo ago by matthewsnyder‭  ·  last activity 6mo 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 6mo ago by Karl Knechtel‭  ·  last activity 6mo 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...

1 answer  ·  posted 6mo ago by Ivan Nepomnyashchikh‭  ·  last activity 6mo ago by Ivan Nepomnyashchikh‭

66%
+2 −0
Q&A Is this AES/CBC scheme, where the IV does not need to be known during decryption, insecure or does it have any other disadvantages?

Usually a random IV is used for encryption with AES in CBC mode, so that key/IV pairs are not reused, which would be a vulnerability. During decryption, the IV of the encryption is required. If de...

1 answer  ·  posted 4mo ago by Holden‭  ·  last activity 4mo ago by Peter Taylor‭

60%
+1 −0
Q&A I can't install the Spacy library using the terminal in VSCode on Windows 10

I am trying to install the Spacy library in VSCode in a folder with a virtual environment. The output appearing in the terminal is excessively long; I will share it with a pastebin later. My versio...

1 answer  ·  posted 2mo ago by Richard‭  ·  last activity 2mo ago by Alexei‭

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 1y ago by matthewsnyder‭  ·  last activity 1y 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 7mo ago by Andrew Ray‭  ·  edited 6mo ago by hkotsubo‭

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

40%
+0 −1
Q&A How to get conditional running cumulative sum based on current row and previous rows?

How do I perform a running cumulative sum that is based on a condition involving the current row and previous rows? Given the following table: acc | value | threshold 3 | 1 | 1 1 | 2 ...

1 answer  ·  posted 6mo ago by congusbongus‭  ·  last activity 6mo ago by congusbongus‭

66%
+2 −0
Q&A how can I run pytest on Flask routes?

I'm trying to implement pytest for one of my Python Flask projects. The application is instanciated like this in appname.py def create_app(): app = Flask(__name__) app.config.from_pyfil...

0 answers  ·  posted 4mo ago by GeraldS‭  ·  edited 4mo ago by GeraldS‭

Question python flask pytest
60%
+1 −0
Q&A Generating combinations of elements, which are themselves sequences of the same length, where the elements have no value in common at any position

This question is adapted from a question I just helped fix up on Stack Overflow. I'm giving a different motivating example which I think will make it clearer what the requirements are and why a n...

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

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

60%
+1 −0
Q&A Simultaneous comparison in Python

I want to make multiple comparisons at once, of the same type, in a Python program. For example, to check whether all of a certain group of strings are in a longer test string; or whether a specifi...

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

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 4y ago by Guilherme Costa‭

Question keras tensorflow