Tagged Questions
4
votes
1answer
53 views
Permutations program in Python
This code asks for letters and a number of letters per word and generates all possible permutations. Then compares those permutations with an English dictionary and creates a list with all the words ...
2
votes
3answers
516 views
Simple hashing code with excessive conditional statements
Any thoughts on my code? It's a simple hashing code that runs from the command line.
There just appears to be a lot of condition if / ...
5
votes
1answer
157 views
Job queue system
I'm doing a side project at work and I consider it as a learning opportunity more than work itself, but it does hold a purpose if I can complete it. Anyway, I'll post the code, what it actually does ...
0
votes
2answers
655 views
Command line tool for extracting, searching, and converting
I just completed my first real application (command line app). It's simple, but I had no prior knowledge of Python. Everything was hit and miss, with many Python books and help from those in this ...
3
votes
1answer
183 views
Is this simple Python console menu solution acceptable?
I am trying to learn Python / programming and have a question about Console style menus.
I was wondering if I am doing it the right way. About the menu:
It is a simple console menu that just holds a ...
9
votes
1answer
2k views
Command-line noughts and crosses
I've just got a Raspberry Pi, so I thought I'd try my hand at some Python. This is my first ever Python program (hurrah!).
It's a very simple command-line implementation of noughts and crosses. The ...
12
votes
2answers
193 views
Drink order program
I'm looking to improve my code to make it more efficient, such as shortening it but continuing to gain the same output, or to add some more complex functions into the code.
...
5
votes
2answers
1k views
6
votes
1answer
193 views
Simple console roguelike game
I have written this small game for the "learn python the hard way" book. I ask for some opinions about it and how to improve it.
I know about pygame and others game engines but all the game runs in ...
1
vote
1answer
302 views
Dynamic user-created menus with sub-menus in a command line script
Questions:
How could this code be written better?
Could this be written in less lines of code if constructed using classes?
Also, If the user-created menu items were to be saved to a file for later ...
3
votes
1answer
64 views
cleaner python — refactoring to reduce noise? (twirling cursor)
Questions:
(1) Is the cost of calling subroutines in Python cheap enough to support refactoring, i.e. pulling out flash() as its own subroutine, ...
2
votes
4answers
252 views
Printing a rectangle
I have an assignment as follows:
Write a program which reads from the keyboard two integers n and m,
and a character c from the keyboard. This program should define and
call a function:
...
6
votes
1answer
211 views
Is using 'yield' a sensible way to report progress of data processing?
I have a function that processes a large amount of data. I call this function as part of a wider process via a command line script in which many similar but shorter jobs are conducted in sequence.
I ...