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

learn more… | top users | synonyms (1)

3
votes
1answer
114 views

Simple Hangman game in Python

I recently started learning Python, and made a simple text based Hangman game. I wanted to know if there could be anything done to make the code cleaner or more efficient. ...
0
votes
0answers
6 views

Improving the performance of web scraper using BeautifulSoup

I am using python3 with Beautiful Soup to scrape web site, I also used Thread to download images, but it will spend more than 30 minutes to get all information and download relevant images, how can I ...
9
votes
0answers
41 views

n-queens puzzle in Python

I want to increase the efficiency and reduce the time complexity for the n-queen problem in n*n matrix chess. I am able to run only still (11*11) in normal time otherwise for the big number it is ...
2
votes
1answer
10 views

Redshift Load and Unload Wrapper class

We do constant traffic with our Redshift tables, and so I created a wrapper class that will allow for custom sql to be ran (or a default generic stmt), and can run a ...
-2
votes
0answers
56 views

Print grades in table form [on hold]

I want help. I wrote my program but it should return this: ...
2
votes
0answers
17 views

Adaptive scan of function concurrently

This function try to scan the given function in n dimensions in the given range by adaptively divide the area into n+1 points polygon (e.g. triangle in 2D; tetrahedron in 3D) I tried to seperate the ...
2
votes
2answers
38 views
2
votes
0answers
31 views

Controlling the order of unittest.TestCases

Apparently everyone gets burned by their Python unittests not running in the order they want. I am not in the business of telling people not to do perfectly reasonable things they want to do, so I ...
-3
votes
0answers
20 views

Printing to two decimal places [on hold]

I have created a salary calculator which takes into account tax and national insurance to give the user a specific salary after tax and national insurance. Could anyone please assist me on how I can ...
2
votes
1answer
47 views

Convert custom format to XML Template

I have just finished writing a simple Python3 program which converts a custom input file (or multiple files within the same folder) to an XML template. It works as it is, but I think that I somehow ...
3
votes
1answer
65 views

A phone troubleshooting program

The code should ask the user multiple solutions and find the problem with the users phone. The program should be efficient as possible and have a possible of 10 outcomes. I would like some tips on how ...
2
votes
0answers
24 views

Execute coroutines in pool

I want to run all the coroutines from the list in a pool of constant size and would like to ask if this is the right way how to achieve it. Is there any built in solution for this problem? I have not ...
3
votes
1answer
26 views

Python Weighted Object Picker

I've designed a class ObjectPicker that can be given objects and weights. Objects can be picked randomly out of the ...
5
votes
3answers
168 views

My first finished Python program: a deck of cards

I've recently started learning how to code in Python, and have even more recently learned the basics of object-oriented programming. Feeling inspired, I started on a program that would generate random ...
4
votes
2answers
42 views

Storing disassembled data in a structured way

I want to store the information returned by the dis function of the dis module in a structured way, using a dict, associating the mnemonics of each code of a line to the correspondent line number. ...
0
votes
0answers
20 views

Web Crawler with Python and the asnyncio library

I am trying to experiment with Python 3.5 async/await and the whole asyncio library. I tried ...
3
votes
2answers
55 views

Python Caesar Cipher

I am a student doing their AS Computing course and I have created a piece of code in which a message can be typed and then scrambled by moving letters along the alphabet. I was wondering if anyone ...
26
votes
3answers
1k views

Bush Wanderer - code intended for teaching

I am teaching computing to an AS class and this was their assignment: Bush Wanderer Task 1 Create a 5x5 grid of hashes(#) where the player is an ...
2
votes
0answers
43 views

Execute commands over Telnet, logging to a file

I have made some code that will login to a device and send all your additional commands. It also logs the commands and the returned values to a file on the local system. Hope somebody can tell me if ...
8
votes
2answers
793 views

Skill creation in a Python text-based RPG

I am in the process of creating a text-based RPG for the purpose of learning more about OOP in Python. Right now things are going well, but I'm facing a problem that I don't exactly can find a good ...
3
votes
2answers
41 views

Constraining stdin in Python, v2.0

Rags, again. This is the rewrite of Read stdin like a dictator. From that post: All too often I find myself wanting to allow only a certain list of characters to be written to stdin, and only ...
7
votes
1answer
98 views

Fuzzy / approximate text matching program in Python

I'm trying to build a program that will find approximate text matches between two texts. Basically, I'd like to find a way of identifying quotations, so that when an author quotes, say, the King James ...
3
votes
1answer
29 views

GPSD socket connection and decoding JSON into Python dictionaries

GPS3 is a python 2.7-3.5 interface to GPSD. I've stripped back everything to two classes. ...
2
votes
0answers
12 views

Base class for the Oauth process and dance

At work we are interfacing with the Jira cloud storage for our ticket management system. I created a base class to make the process easier on the user side, and I did my best to make it re-usable and ...
1
vote
1answer
44 views

Adding items in a list

I wrote a function that adds items in a list, but my professor says to try and write it in a simpler way because he says I take too many steps. Is there any other way to write this? ...
5
votes
2answers
92 views

Team Fortress 2 item price lookup using Trade.tf developer API and Steam WebAPI

I've made a nice little Python program using the requests module using the Trade.tf Developer API and the Steam WebAPI allowing the user to look up the price of ...
5
votes
3answers
670 views

Python colour game

This is a Python program that requires the user to type the colour of the text and not the name of the colour. They have a set time limit and a scoring system. If you have any improvements or ...
3
votes
3answers
61 views

Avoiding numbness with Python Enum

First, the context: I'm working with a student to build a web frontend for a star cluster simulation package called starlab. Typical starlab usage involves ...
20
votes
3answers
602 views

Calculate questions per day on CodeGolf.SE

I wrote a short script in Python 3 that connects to the Stack Exchange API, gets all questions on Programming Puzzles & Code Golf over the past two weeks, and determines the average number of ...
2
votes
1answer
55 views

Tic-Tac-Toe game in Python-3.x

I would really appreciate a general review of my Tic Tac Toe game in Python as I have spent a lot of time on it. Any improvements or suggestions? ...
1
vote
0answers
29 views

Start the Python interpreter with an import statement

When I'm writing Python, I wanna be able to pull up an interpreter quickly, and import what I need easily. Previously, this involved: ...
11
votes
4answers
1k views

Python sprinting game using strings, loops and statements

Here is my code for a sprinting game in Python. You have to tap the 'a' and 'd' keys as fast as you can to run 100 meters. Any improvements? ...
3
votes
1answer
109 views

Python computing quiz

The following code is a computing quiz: ...
2
votes
1answer
184 views

Encryption and decryption using alphabetic shifts

My first piece of code encrypts text by moving each letter in the string 5 letters across in the alphabet. ...
0
votes
0answers
21 views

Email a notification when detecting changes on a website - follow-up

I read through other questions here and improved the code and added a new feature. The old question can be found at: Email a notification when detecting changes on a website The improvements that are ...
5
votes
1answer
46 views

Markov chain text generation in Python

I'm willing to listen to any advice you have for improving it. ...
3
votes
2answers
24 views

Partitioning comments by date

I have a list of Comment objects comments. Each Comment has several properties, one of which ...
5
votes
3answers
221 views

Email a notification when detecting changes on a website

The text of a website is checked in a given time period. If there are any changes a mail is sent. There is a option to show/mail the new parts in the website. What could be improved? ...
3
votes
2answers
403 views

Python exception handler to recommend package

Consider this python 3 snippet, where when an import exception is raised, a string 'e' is created that says: "No module named ' packageName'". The goal is to simply say on exit, that the import error ...
0
votes
0answers
28 views

Decorating a timeout function

I've picked up the timeout-function below from ActiveState's recipes for Python2 and polished it for python3.4. Is there any leaner, less clunky way to write it? ...
5
votes
1answer
52 views

Struct in Python

I'm writing a struct class in Python and was wondering if this were a good way to write it: ...
-3
votes
1answer
23 views

Couting items problems [closed]

Hello I want to write some code in python that accomplishes the following: Input and store number of items in a consignment. Use some validation to determine whether the parcels can be accepted or ...
3
votes
2answers
64 views

Generating simple and complex passwords

I am pretty new to Python and I would like some tips and criticism on my formatting style/code and what can be better organized. I am a bit shaky on how classes work, but I think that it can be used ...
7
votes
1answer
84 views

Checkers in Python 3

I'm writing a small checkers game in python (international rules) and I need some pointers here and there. For the moment, I am only drawing the board and checking the syntax of moves with a regex. ...
3
votes
1answer
45 views

Minimal, Low-level Telnet API

I've started Python some days ago and wrote a small Telnet implementation according to RFC 854 and RFC 5198. It is pretty low-level and sending messages directly isn't even supported. The highest ...
1
vote
1answer
32 views

An ETA plugin for hangoutsbot

This is a plugin for hangoutsbot/hangoutsbot that listens for words people say and then gives them an ETA and a link with directions. Happy to hear about any optimisations that could be made. ...
6
votes
2answers
66 views

N-Bonnaci sequence calculator

The code calculates a n-bonnaci sequence to a certain number, based on the user's input. It then can print it to a file and/or print it to the console. The ...
6
votes
2answers
158 views

Validating ISBNs

I'm just looking for a cleaner way. Obviously I could store a variable for some of the int parts. Personally, I think the one-liner looks better and everyone's ...
1
vote
1answer
55 views

Created a frame with a disabled button, till check button is used, then return to starting state

I've been coding Python for little over 6 months now. I am self taught and I would like to ask for some help for myself and also for others in my position who's been wondering if they're going about ...
7
votes
2answers
78 views

Calculate food company sales for the year

I am working on a Python project where a food processing company is trying to calculate its total sales for the year. Python has to read from a text file where its divided into for categories split by ...