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
 
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‭

Question python mypy typing type-hinting
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‭

Question python tensorflow tensorflow-eager-mode tensorflow-graph-mode tensorflow-function
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‭

Question python tensorflow prefix-operator infix-operator tensor
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 1y 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 11mo ago by Karl Knechtel‭  ·  last activity 11mo ago by Karl Knechtel‭

Question python installation package
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 10mo ago by matthewsnyder‭  ·  last activity 10mo 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 10mo ago by Karl Knechtel‭  ·  last activity 10mo ago by Karl Knechtel‭

Question python startup command-line-interface
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...

2 answers  ·  posted 9mo ago by Ivan Nepomnyashchikh‭  ·  last activity 15h ago by Preginund‭

Question python windows box-drive
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 8mo ago by Holden‭  ·  last activity 8mo ago by Peter Taylor‭

Question encryption aes cbc-mode
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 6mo ago by Richard‭  ·  last activity 5mo ago by Alexei‭

Question python visual-studio installation terminal spacy
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 4y ago by ajv‭  ·  last activity 4y 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 3y ago by celtschk‭  ·  last activity 3y ago by r~~‭

Question enum python-3 python-protocol-type
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 3y ago by celtschk‭  ·  last activity 3y ago by Nick Alexeev‭

Question python-3 state-machine
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‭

Question python linux command-line-interface scheduling
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 10mo ago by Andrew Ray‭  ·  edited 10mo ago by hkotsubo‭

Question python operator-overloading operators python-3
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 10mo ago by Karl Knechtel‭  ·  last activity 10mo ago by Karl Knechtel‭

Question python runtime-environment python-venv
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 10mo ago by Karl Knechtel‭  ·  last activity 10mo ago by Karl Knechtel‭

Question python startup entry-point
60%
+1 −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 10mo ago by Karl Knechtel‭  ·  last activity 10mo ago by Karl Knechtel‭

Question python installation python-venv
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 10mo ago by Karl Knechtel‭  ·  last activity 10mo ago by Karl Knechtel‭

Question python standard-library
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 9mo ago by congusbongus‭  ·  last activity 9mo ago by congusbongus‭

Question apache-spark pyspark
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 8mo ago by GeraldS‭  ·  edited 8mo 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 5mo ago by Karl Knechtel‭  ·  last activity 5mo ago by Karl Knechtel‭

Question python algorithms combinatorics
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 5mo ago by Karl Knechtel‭  ·  last activity 5mo ago by Karl Knechtel‭

Question language-agnostic logic
66%
+2 −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 5mo ago by Karl Knechtel‭  ·  last activity 5mo ago by Karl Knechtel‭

Question python operators logic
57%
+2 −1
Q&A How shall I refer to the documents and the context in the prompt when using the Azure RAG-QA framework?

I use Azure OpenAI RAG-QA (aka "bring our data"): which I call via e.g.: import os import pprint from openai import AzureOpenAI #from azure.identity import DefaultAzureCredential, get_bear...

0 answers  ·  posted 12d ago by Franck Dernoncourt‭  ·  edited 11d ago by Franck Dernoncourt‭

Question azure azure-cognitive-services