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.

1,518 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
14 votes
0 answers
826 views

Let's register that Django user

Short intro So, I've been using Django for a while now and thought it would be nice to start a simple application. In an ideal World, each app must have a way of letting its users register and that's ...
Grajdeanu Alex's user avatar
14 votes
0 answers
954 views

Django on virtual machine - watching changes in static files and autocompiling LESS without inotify

I'm setting up a Django development environment using Vagrant to run an Ubuntu virtual machine on VirtualBox. As this is a student project run mostly by very amateur coders and I want everyone to be ...
Waiski's user avatar
  • 378
11 votes
0 answers
3k views

Sending notifications with Django channels

I have project on Django wich use Django Channels. I use Django Channel for sending notifications to users who are subscribed to articles changes (adding/editing/deleting comments on article). So I'...
KIN1991's user avatar
  • 211
10 votes
0 answers
1k views

Cyther: The Cross Platform Cython/Python Compiler (Take 2)

I recently posted an earlier version of this code on Code Review, and now with the given suggestions and many other improvements, I am back. I included the description of exactly what Cyther is ...
Nick Pandolfi's user avatar
8 votes
0 answers
147 views

Calculation of independence test statistic

This code (~30lines) detects independence between variables in a dataset, by using a bootstrap of a statistic. This is fully-broadcasted, but it's still long. Reading it, or making it run, do you ...
lrnv's user avatar
  • 195
7 votes
1 answer
245 views

Python asyncio multithread wrapper

For my application, I needed a lightweight way to launch multiple tasks and monitor their completion in a main loop periodically or use callbacks. The main loop is going to be busy most of the time ...
ROMSCore's user avatar
7 votes
1 answer
125 views

GUI that reads data and generates/ saves charts

I have a program that uses pandas to read csv files and then generates and saves graphical charts. I have been trying to follow the SOLID principles so I have tried to seperate responsibilities. So ...
JudasMoses's user avatar
7 votes
1 answer
188 views

Structuring of my tkinter music player program

This music player app hasn't really completed yet but it runs the basic functions of a music player, which include play/pause, volume adjustment, next/prev, shuffle and repeat functionalities. However,...
CoreVisional's user avatar
6 votes
0 answers
255 views

Thread Art Generation that Creates Embroidery Files

I have made a thread art generator that creates thread patterns from images. Mine is a bit different as it outputs an embroidery file (It embroiders quite nicely, though the settings need a lot of ...
GameDungeon's user avatar
6 votes
1 answer
499 views

Image puzzle PIL tkinter

I'm a hobbyist programmer(just having fun) created a small script that takes a photo and resizes it, then cuts it up into 24 pieces. The chunks are transposed and made into buttons. Your task is to ...
just_joe's user avatar
  • 186
6 votes
0 answers
449 views

Xero API Client in Django

I'm not actually that new to writing Python. But I've no formal training and have only learnt to build applications to solve problems for my job out of necessity. Starting to bring my existing skills ...
Simon's user avatar
  • 61
6 votes
0 answers
88 views

Subtracting elements of datasets of an HDF5 file

I am trying to solve the following problem: Input: Input is two arrays (Nx4, sorted in column-2) stored in datasets-1 and 2 in HDF5 file (input.h5). N is huge (...
nuki's user avatar
  • 61
6 votes
0 answers
103 views

K nearest neighbours algorithm

Here is a project that I worked on for a few days in June 2020. Since the algorithm is extremely slow, I looked into methods in order to parallelize operations but did not obtain any satisfactory ...
Aaron John Sabu's user avatar
6 votes
0 answers
93 views

Python - Displaying messages in ArcPy/IDLE

I have created a wrapper for displaying messages with ArcPy and IDLE (as that is all I have available to myself due to certain circumstances) as I frequently use both to test and develop new tools. ...
user avatar
6 votes
0 answers
5k views

Cubic spline interpolation in Python from scratch

I implemented the cubic spline interpolation explained in https://en.wikipedia.org/wiki/Spline_interpolation as a Python class. Of course, such an interpolation should exist already in some Python ...
Ivan ZAR's user avatar
6 votes
0 answers
997 views

2048 AI in Python 3

I am working on an 2048 AI and this is my code so far. In the game 2048 you have a 4x4 grid in that some random so named tiles spawn. Each tile has a number. The lowest number is 2. By using the left,...
codeglow's user avatar
6 votes
0 answers
736 views

Laminar flow in a pipe animation using Tkinter

I wrote this simple particle flow animation with Tkinter. I wanted to ask if there is some major improvements you can think of regarding the animation motor or the documentation of my code? I noticed ...
Putzikki's user avatar
6 votes
0 answers
2k views

Fibonacci heap in Python

I have this implementation of the Fibonacci heap in Python: ...
coderodde's user avatar
  • 27k
6 votes
0 answers
254 views

Selection sort with reduced comparison count: Python iteration 2

Follow up to Selection sort with reduced comparison count - semi-final Iteration? My goal (and excuse not to tag reinventing…) is to have presentable code to argue the viability of reducing the number ...
greybeard's user avatar
  • 6,104
6 votes
0 answers
9k views

Example of multithreading in Python3 / PyQt5 using QThread

I wanted to make a simple example of multithreading with QThread in PyQt5 / Python3. The script generates a set of QLineEdits and buttons to start and stop a set of ...
SDiv's user avatar
  • 161
6 votes
0 answers
449 views

Simple AR Tag classifier

I have been working on creating a simple AR Tag classifier, for detecting a simple AR Tag glyph. Spitting out an image that looks like this: With the red circle indicating the corner closest to the ...
Mark Omo's user avatar
  • 449
6 votes
0 answers
80 views

Pyspark Solver for Tiered Board Games

I've written a Pyspark program that will completely solve a tiered board game (no loops, each game position is a member of only one tier) and writes each tier to a file. It also determines the ...
Michael's user avatar
  • 61
6 votes
0 answers
3k views

Real-time bitcoin data feed and storage using websocket framework

I'm trying to create data feed script for real time bitcoin data for OkCoin exchange using their websocket API (documentation) and a database manager for storing. There are two channels I am ...
user56951's user avatar
5 votes
0 answers
220 views

GUI Tic-Tac-Toe game with six AI players - part 1: the UI

This is a huge project that I have worked on for the past few months, it contains 16 scripts, one of the scripts is used to analyze the other scripts. There are 111004 characters in all the script ...
Ξένη Γήινος's user avatar
5 votes
0 answers
70 views

CLI reading logger in Python

EDIT Updated code This is my first real project in Python, and also my first time using sql databases. The purpose was initially to provide a very simple interface to track my reading hours using logs,...
user avatar
5 votes
0 answers
50 views

Message-free flow-oriented logger

Today, I've got a small FlowLogger for you to review. The idea is not to log pure messages, but focus on the flow of the app that might contain such items as: <...
t3chb0t's user avatar
  • 44.1k
5 votes
0 answers
109 views

A Python script that creates n-flakes

I have written a simple Python script that generates n-flakes using matplotlib. Wikipedia article on N-flake. I wrote two functions, one function generates pentaflake, the other generates hexaflake, I ...
Ξένη Γήινος's user avatar
5 votes
0 answers
143 views

A Python 3 script that generates art using matplotlib

I am always super interested in both science and art, science and art are two different ways to describe the objective reality, they are two sides of the same coin, in many areas they overlap, and ...
Ξένη Γήινος's user avatar
5 votes
0 answers
183 views

@lazylist - Converts a Python Generator to a List without evaluating every element

Inspired by a blog I read, I made a LazyList class that can wrap an iterable (list, generator etc.) and turn it into a ...
Greedo's user avatar
  • 2,345
5 votes
0 answers
563 views

Simple snake game in Python

I have created a snake game in Python. It is a single-player game, where the snake has to eat the red dots in order to grow longer. I just wanted to review if there are any improvements. ...
Ghost's user avatar
  • 185
5 votes
0 answers
1k views

Scraping OddsPortal with requests only

This is a scraper written to do most of what had been attempted by another user in this question: How can I optimise this webscraping code I did the rewrite because I felt bad that the new user didn't ...
Reinderien's user avatar
5 votes
0 answers
222 views

Pi Calculator Using BBP (Bailey–Borwein–Plouffe) - Written in Cython With MPFR

I wrote a Pi Calculator using the BBP Algorithm in Cython. My specific goals are make the code more legible and more performant. This is a purely academic script in order to teach me how to implement ...
Alexis Evelyn's user avatar
5 votes
0 answers
404 views

Process Injector using ctypes and the Windows API

To get some practice with the Windows API and ctypes, I decided to write a program capable of injecting and running shellcode inside of another specified process. ...
Carcigenicate's user avatar
5 votes
0 answers
177 views

stable producer/consumer threads in python

I have implemented a producer/consumer functionality using threads in a given framework and I'm pretty sure I did not cover all possible scenarios. I made a small reproducible version. Lines ending ...
Raubsauger's user avatar
5 votes
0 answers
899 views

Reading sensor data from serial device and publishing on MQTT

I have a weather station with a data logger which accepts commands (specified in user manual) and sends back the respective data over a serial interface. In my case, I want to read the current data ...
wuff1337's user avatar
5 votes
1 answer
119 views

Approximation search source reconstruction localization algorithm

Goal To determine the coordinates of some signal source in a 3D space, given the coordinates of four observers and the time at which each saw the signal, as well as the velocity of the signal. ...
10GeV's user avatar
  • 285
5 votes
0 answers
213 views

Text-based tic-tac-toe game in Python

I'm working on a text-based tic-tac-toe game, mostly for fun and because I'm learning programming. I would appreciate any comments you could give me to improve it. Main structure: Uses a Board class ...
fabrizzio_gz's user avatar
5 votes
0 answers
823 views

safexl - A Python / pywin32 Excel Application wrapper

Thanks in advance for your interest in my first PyPI project. While there happen to be a number of projects out there to help with creating & consuming Excel workbooks, I was unable to find one ...
ThePoetCoder's user avatar
5 votes
0 answers
70 views

Machine Learning Implementation

I am new to ML and I wanted to implement a Linear Regression to predict a golfer's scores based on certain feature supplied to my model. I would like a review to see if I'm implementing this correctly ...
Austin Johnson's user avatar
5 votes
0 answers
728 views

Selecting child contours in OpenCV

I'm really new to OpenCV. :) I have been working on this for almost an entire day. After hours of sleepless work I would like to know if I can further improve my code. I have written some code to ...
Avishka Dambawinna's user avatar
5 votes
0 answers
99 views

Dealing Synchronous Request in Asynchronous Code

Problem I am trying to convert my synchronous code to an asynchronous implementation. Using aiohttp I was able to almost get where I want. My problem is how to ...
user101's user avatar
  • 151
5 votes
0 answers
282 views

Simple dmenu launcher for passwords, docs, notes and application shortcuts (Python)

I created a small script for automating password store management and quickly searching and launching notes, shortcuts and documents through some keybindings that will execute the script. Script is ...
silveiralexf's user avatar
5 votes
0 answers
353 views

what is the correct way to write an endpoint?

Here is a rather large endpoint that I have written in Python using Flask and SQLAlchemy, I was wondering if there are any tips I could get. The endpoint takes a post request which contains specific ...
dmc94's user avatar
  • 173
5 votes
0 answers
651 views

Liveness monitor : python and RabbitMQ together through Pika

I'm a beginner using Python, and I'm trying to implement a functionality of a monitor program already developed by an other programmer. This program is working on a Windows machine (made by Inno ...
Hooli's user avatar
  • 181
5 votes
0 answers
799 views

Docker-compose for task-based Flask API with Redis and rq

I am not a Docker guru or expert in Flask or Redis. However, I need to leverage these technologies. I managed to cobble something together that works and would like to submit it for review. The MWE ...
SumNeuron's user avatar
  • 271
5 votes
0 answers
57 views

Form deserializer for Python Flask

I've started working on a small Flask project for no real reason other than fun, and pulled myself back on form validation. I realize that there are existing libraries like WTForms, but wanted to try ...
user avatar
5 votes
0 answers
174 views

Linny: Continued Language Development

A previous question regarding Linny exists here. After a wonderful response on my previous question regarding my developing programming language, I worked on it for a couple days, and am returning ...
Linny's user avatar
  • 9,989
5 votes
0 answers
89 views

Scraping a hiring website using python's requests and BeautifulSoup

I'm designing a scraping application using python, requests and BeautifulSoup4. I decided to divide the logic into two classes: Spider : gets the base url ...
Iduoad's user avatar
  • 151
5 votes
0 answers
61 views

Tensorflow loop to analyze gradients derived from MRI and PET images

The code shown below takes the partial derivative of each pixel of the output fused image of a neural network with respect to input image of the neural network using tensorflow's ...
Nishant Kumar's user avatar
5 votes
0 answers
92 views

Parsing Long Excel Report Files for Predefined Results

I work as an IT intern in a multinational and I was given a tedious task of combing through a 2500+ long multi-column excel report file in search of inactive servers. Here's a sample row from that ...
baduker's user avatar
  • 1,348

1
2 3 4 5
31