Skip to main content

All Questions

1 vote
1 answer
41 views

Send a QNetworkRequest with a parameter

I want to send multiple QNetworkRequests in Python 3.12 that each downloads one image from a server, using a single callback function. To be able to distinguish ...
Neph's user avatar
  • 113
2 votes
3 answers
693 views

Capture multiple errors before raising an exception

I have a scenario where I need to store values from some environment variables (names of which I cannot control). My first run at this was pretty basic, however this is not usable as an exception ...
David Gard's user avatar
7 votes
2 answers
281 views

Subtract two lap times (m:ss:fff)

I have two lap time strings I need to subtract, the format is minutes, seconds, milliseconds. This is to compare a new world record time to the previous holder's ...
Soda Party's user avatar
5 votes
1 answer
213 views

Compute the mean of a series of user-entered numbers

Which is more elegant out of two methods as mentioned below mostly from memory prospective? Both methods achieve the same result, but from a memory perspective, In Method1, we are storing the running ...
Karn Kumar's user avatar
10 votes
2 answers
911 views

Leap Year Calculator Using If Elif and Else Only

I'm taking the 100 Days of Code (Python) taught by Angela Yu on Udemy. There have been a few other questions revolving around this lesson but I can't find one who came up with my specific question so ...
AGM's user avatar
  • 103
6 votes
3 answers
615 views

Implementing a --assume-yes/--assume-no command line flag to affect a `input()` based `confirm()` function

I have a Python command line application that needs to ask the user for confirmation at some point. I want to add a --assume-yes/...
Lucas's user avatar
  • 161
1 vote
0 answers
63 views

Combined or separate data-cleaning routine

I am a junior data engineer that have 3 years of experience with Python. I write a lot of Python code for my job and I came up with this question I can't solve by my own. I don't have the chance to ...
Izem's user avatar
  • 11
1 vote
0 answers
59 views

Revised: best practice of communicating with an instrument using Python

This is a revised version of the code from the previous question. It corrects the spelling errors, add in appropriate comments for argument types and doc strings, rewrite number representation, and ...
cloud chang's user avatar
3 votes
1 answer
288 views

Best practice of communicating with instruments using Python [closed]

I have seen two different methods - getter and setter method and property - being used in Python libraries which are written for communicating with instruments via VISA commands. An example is given ...
cloud chang's user avatar
3 votes
0 answers
36 views

TestAssignment class that checks for certain Git repository conditions

TestAssignment is a Python class designed to check certain conditions in a Git repository. It has several methods that check for the existence of required files, the initialization of a Git repository,...
Beki's user avatar
  • 31
2 votes
3 answers
107 views

Wordlist formatter code

I am making a "wordlist cleaner" module that loads a words.txt file, and returns a list of cleaned/sorted words. Full code: ...
angel's user avatar
  • 35
1 vote
1 answer
203 views

Excluding attributes entirely vs. setting them to None

I am making a program that parses profiles from a website. Some profiles are "public" and others are "private" with limited information. Public profiles contain a lot more data and ...
angel's user avatar
  • 35
0 votes
1 answer
174 views

Getting three numbers input interactively and process them

I'm new to Python and programming in general. Let's imagine I have a simple task: Given 3 numbers from user input, I need to count negative ones and print the result. Considering what I know about ...
QLEDHDTV's user avatar
3 votes
2 answers
930 views

Convert Rankine temperatures to Celsius

I have this Python Package called ToTemp under development for precise Temperature Conversions and currently thinking in changing the method's implementation to be ...
eddyxide's user avatar
  • 141
0 votes
1 answer
71 views

Comparison of two ways of looping in Python [closed]

I wrote a small script to demonstrate two ways of looping in Python: with and without using the index. I want to know which way is better. Please see the example: ...
Jeremy's user avatar
  • 111

15 30 50 per page
1
2 3 4 5
13