Skip to main content

Questions tagged [python]

Python is an interpreted, general-purpose high-level programming language whose design philosophy emphasizes code readability. Use the python tag for all Python related questions. If you believe your question may be even more specific, you can include a version specific tag such as python-3.x.

222 votes
4 answers
25k views

I applied for a job and they asked me to write code with the following requirements: Get a "toolbar offer" description from http..update.utorrent.com/installoffer.php?offer=conduit. Parse the ...
user26614's user avatar
  • 2,209
128 votes
6 answers
18k views

I just wrote a snow animation in Python. I think this is fairly clean but I have a few things that I don't like. ...
J Atkin's user avatar
  • 1,820
84 votes
4 answers
22k views

The following function works well to print out a help message for the program I have written. It prints a multi-line string message that describes the command line usage with some examples: ...
noisy's user avatar
  • 1,001
77 votes
3 answers
20k views

I was advised by a Reddit user to get my code reviewed on this site. The complete code is on GitHub. ...
ohjuny's user avatar
  • 873
74 votes
5 answers
11k views

I have written an app in Python 3 which monitors internet speed and will send a tweet to an ISP when the speed drops too low. The app has a config file where the ISP and target speeds can be ...
Sir_Steadman's user avatar
71 votes
2 answers
98k views

I'm working on a Python script and I was searching for a method to redirect stdout and stderr of a subprocess to the logging ...
DracoJem's user avatar
  • 811
70 votes
4 answers
58k views

I'll soon begin teaching a beginners' programming class. It's voluntary, so I thought I'd make it interesting by teaching Python programming and then introduce the kids to Pygame, so that they can ...
Timo's user avatar
  • 807
62 votes
6 answers
6k views

So a friend happened to show me how odd and specific the general email syntax rules are. For instance, emails can have "comments". Basically you can put characters in parentheses that are just ignored....
SuperBiasedMan's user avatar
61 votes
10 answers
4k views

I started programming with Java and C++, so I'm used to having a 'main' function that calls other functions that do the actual work. At university I was always told that doing actual computation in ...
Basil's user avatar
  • 871
60 votes
9 answers
14k views

I'd like suggestions for optimizing this brute force solution to problem 1. The algorithm currently checks every integer between 3 and 1000. I'd like to cut as many unnecessary calls to ...
Robert S Ciaccio's user avatar
58 votes
3 answers
69k views

I wrote a solution to the Knapsack problem in Python, using a bottom-up dynamic programming algorithm. It correctly computes the optimal value, given a list of items with values and weights, and a ...
voithos's user avatar
  • 862
57 votes
2 answers
4k views

My son just started high school and in Math, he was asked to do some stats homework. The exercise was to count all the vowels in a passage of text, then answer some questions about frequency. Out of ...
nedlud's user avatar
  • 689
52 votes
3 answers
172k views

I'm trying to find the closest point (Euclidean distance) from a user-inputted point to a list of 50,000 points that I have. Note that the list of points changes all the time. and the closest distance ...
dassouki's user avatar
  • 1,101
48 votes
1 answer
4k views

Problem: I have seen a few questions around hangman. Usually this is done in a very hackish way, which usually can not be generalized any further. My thought or question is about the creation of the ...
N3buchadnezzar's user avatar
47 votes
8 answers
11k views

I have a function to calculate the normal distribution in Python: ...
alvas's user avatar
  • 709

15 30 50 per page
1
2 3 4 5
1046