Skip to main content

Questions tagged [python-3.x]

Python 3 is the latest version of the Python programming language and was formally released on December 3rd, 2008.

Filter by
Sorted by
Tagged with
5 votes
2 answers
736 views

In Python when you want a local variable, you just assign to it x = 10. In most modern languages you declare local vars (regardless of type): JavaScript: let/const/var Swift: let/var Kotlin: val/var ...
noamtm's user avatar
  • 235
1 vote
3 answers
616 views

I have reviewed this, but it doesn't seem to address what I'm asking here. https://stackoverflow.com/questions/15727420/using-logging-in-multiple-modules I want to have multiple programs call the same ...
NealWalters's user avatar
2 votes
3 answers
457 views

This is a conceptual question about whether my specific use-case warrants the use of an asynchronous API. Language: Python 3.11 Framework: FastAPI (ASGI) I believe I am confused about what an ...
nonohat's user avatar
  • 53
0 votes
1 answer
231 views

I am currently developing an application in Python that has a match making functionality to form sports teams of 4 and group them by skill. The following has been implemented and works. E.g. Form ...
serge's user avatar
  • 9
2 votes
2 answers
170 views

Consider the following python3 code: from abc import ABC, abstractmethod class Food(ABC): _food_factory_map = {} _recipes = {} @classmethod def getFood(cls, foodName): return ...
raghavj's user avatar
  • 29
1 vote
0 answers
1k views

I'm working on a python wrapper for a REST API. I'm using python data classes to store the shape of the JSON response of each endpoint so developers have features like autocomplete and objects they ...
rsn's user avatar
  • 127
-2 votes
1 answer
91 views

Here's what I want to achieve: while complex_compound_condition_statement: foobar() # ... do some stuff I would like the log output of the above to be: <timestamp> INFO: started doing stuff ...
user247243's user avatar
5 votes
1 answer
365 views

I am a very beginner writing one of my first webapps. I'm using FastAPI and I'm stuck on the logic of creating an endpoint that has to do a lot of things before it returns something back to the user. ...
Jinx's user avatar
  • 159
2 votes
2 answers
333 views

I am working on a problem with lots of if-then-else calculations. I am trying to compartmentalize the logic to make it more maintainable and less error prone. But, as I try options, I don't see what ...
eSurfsnake's user avatar
4 votes
2 answers
2k views

I'm working to create a library in python that myself and a few colleagues will use. I'm struggling to conceptually understand how to best organize some code that feels like it doesn't cleanly fit ...
user avatar
13 votes
6 answers
12k views

In python I often see functions with a lot of arguments. For example: def translate(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p): // some code return(x, y, z) I like this pattern in some ...
P. Hopkinson's user avatar
0 votes
0 answers
55 views

i have as a mechanical engineering student in my practice semester to create a database that includes about 100k+ paths to images in our network. Every, lets say week, i have to synchronize all ...
Prodigy's user avatar
0 votes
1 answer
127 views

In our company we have a requirement where we would like to store hundred thousands incoming records per seconds. we currently a pub-sub model for processing many records(100/sec) from many system(~...
vector8188's user avatar
1 vote
3 answers
6k views

I'm trying to get a good understanding as to whether there is a best practice or standard regarding keeping values within your code libraries or referencing them from another config file. I don't ...
Kyle's user avatar
  • 13
-1 votes
1 answer
365 views

I am amazed by the way APIs of some machine learning packages are designed, namely Chainer's and Pytorch's "define-by-run" API. Even Optuna, a hyper parameter tuning library has "define-...
Manishankar Singh's user avatar
-1 votes
1 answer
2k views

(Using python) I am looking to generate a bytes (or can be string that I convert to bytes) that is a message to send over TCP. The format is [Header][Length][Payload]. Within [Header] is a [...
SimpleOne's user avatar
  • 199
3 votes
2 answers
1k views

This is the mess of imports currently at the top of my file: import argparse from copy import deepcopy from functools import cmp_to_key, partial from itertools import chain import math from ...
user avatar
-4 votes
1 answer
1k views

I have a txt file from where I want to create new files based on the data which is up to '$'character. My input file looks like: string1 string2 string3 $string4 string5 $string6 string7 ... (and so ...
IvanM's user avatar
  • 11
1 vote
1 answer
187 views

I'm working on python microservices based app and I'm wondering how to ship updates. Let's start by a summary of what I have: Code base on git (several repos) The app is running on several remote ...
AFZ84's user avatar
  • 13
-4 votes
1 answer
150 views

I have a piece of code that I developed in an academic context for which I would like to build a nice frontend. My approach to coding has been very academic to this point (read: I made stuff up as I ...
KBriggs's user avatar
  • 115
-2 votes
1 answer
142 views

Forgive my jargon , as I'm not very familiar with Constraint Satisfaction Problem(s) or Linear Programming procedures (For eg: Presolve) I have very trivial constraint set from variables of ...
Prasanna 's user avatar
-1 votes
1 answer
246 views

So, recently I have been doing a lot of programming in Python. I have noticed that my programs can be somewhat hard to read. I usually have one main class which does everything, sort of like this: ...
In Hoc Signo's user avatar
-1 votes
3 answers
612 views

I was doing a Monte Carlo implementation of the Birthday Paradox in Python and I wanted to check if the results where the same as in the analytical implementation of the same problem (As they should ...
Edoardo Busetti's user avatar
0 votes
1 answer
173 views

I have a python forecasting application that, for a given Entity, executes a fbprophet model multiple times varying the hyperparameters for each execution while tracking the best fit across the runs. ...
Jay Walker's user avatar
0 votes
0 answers
127 views

I have created a machine learning software that detects objects(duh!), processes the objects based on some computer vision parameters and then triggers some hardware that puts the object in the ...
PanNik's user avatar
  • 67