Questions tagged [python-3.x]

Python 3 is the latest version of the Python programming language and was formally released on December 3rd, 2008. Use this tag along with the main python tag to denote programs that are meant to be run on a Python 3 interpreter only. Do not mix this tag with the python-2.x tag.

365 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
10
votes
0answers
174 views

Population dynamic simulation on biological information maintenance 2

This question is the follow-up to this previous question. Background Using this simulation I investigate a system in which enzymes proliferate in cells. During the replications of enzymes, ...
7
votes
0answers
512 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 ...
6
votes
0answers
6k 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 ...
6
votes
0answers
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 ...
5
votes
1answer
151 views

Find website URLs that begin with http:// or https://

This is a problem from Automate the Boring Stuff from "Pattern Matching with Regular Expression". I am a beginner in Python and the purpose of this program is to match urls which start with ...
5
votes
0answers
66 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 ...
5
votes
0answers
124 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 ...
5
votes
0answers
60 views

graphtimer v2 - Utility to plot timings

GitHub repo (MIT) Clone the repo and replace the contents of example.py with the one at the bottom and you'll have everything setup. Explanation of the code A ...
5
votes
0answers
68 views

Finding unimplemented tasks on Rosetta Code using Requests

This is a Find unimplemented tasks task from Rosetta Code: Given the name of a language on Rosetta Code, find all tasks which are not implemented in that language. There is already a solution ...
5
votes
0answers
207 views

Secure Password and Passphrase Generator in Python 3

I'm aware that people have implemented password/passphrase generators before, but I still went ahead and wrote my own, which I actually use for my own passwords and/or phrases. By "secure", I mean ...
5
votes
0answers
44 views

Comparing same-size files and reporting on the differences byte-by-byte

I created a small Python utility to analyze multiple same-size files and report on the difference byte-by-byte (i.e. Hamming distance, not Levenshtein distance.) I am planning to extend the ...
5
votes
0answers
431 views

Asyncio HTTP Request Queue

I wrote a simple sitemap.xml checker using asyncio and aiohttp. I followed the documentation demonstrating the producer/consumer pattern. However, I noticed that as the URLs scale larger, it seems to ...
5
votes
0answers
71 views

“Backend” of custom app made for editing Google Spreadsheet file

I've been learning some basics of python for few moths now. My friend, who works as salesman at company which sells hookahs, asked me if a could write a simple app which would help him maintain a ...
5
votes
0answers
517 views

Parsing different categories using scrapy from a webpage

I've written a script in python scrapy to parse different "model", "country" and "year" of various bikes from a webpage. There are several subcategories to track to reach the target page to scrape the ...
5
votes
0answers
6k views

(Python) Use IMAP lib to download attachments and email details

This is my first approach to programming in Python, so I hope you will "destroy" my coding! Idea is to use SSL connection to my mailbox and use IMAP to download attachments from emails with ...
5
votes
0answers
1k views

Python script to generate a playlist with the Spotify API

The result is just a list of youtube links. I'm requesting an access token every time and throwing it away, so I'm thinking of a way to save it for future use. Maybe I'll use a tempfile, but even ...
5
votes
0answers
567 views

Start a sub-process (with sudo) as head of new process group, kill it after timeout, get the output

This is a bit of a tricky one ... I am writing a test suite for a Python project - running on Linux. As part of the tests, I have to fire up various commands (shell commands, small CLI tools, Perl ...
5
votes
0answers
586 views

Ramachandran plot (plotting the torsion angles of protein backbone)

I would like to have some insights on the code I created. It would be really insightful for me to get some feedback about the code, what I should do differently, if there is an easier, more elegant ...
5
votes
0answers
409 views

Writing a metaclass to ensure a class is thread-safe

Python allows the creation of classes to be modified via metaclasses. They can perform all sorts of operations that might appear to be magical to languages that do not have the capability. The goal of ...
5
votes
0answers
759 views

Implementing an enum field for peewee.Model

I implemented an enum field class EnumField inheriting from peewee.CharField. The reason that I use a character-based field is ...
5
votes
0answers
990 views

Fibonacci heap in Python

I have this implementation of the Fibonacci heap in Python: ...
5
votes
0answers
104 views

Tokenizing and sorting the strings of a text file with the results of a public competition

I made this script to carry out a specific real-life task, which was to sort a list of candidates in a public competition by grade. The file with the informations consists of a text file copied from ...
5
votes
0answers
138 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 ...
5
votes
0answers
481 views

Django blog application - views, urls, models, forms

I want to learn how to create websites and I have started learning Django web framework. I think Django is very good alternative for PHP and it isn't too complex as JEE. I'm very satisfied learning ...
5
votes
0answers
707 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 ...
4
votes
0answers
19 views

TaskScheduler in python

I have found the need to schedule a few simple functions in a first-come-first-served way so I developed a small task scheduler based on multiprocessing and I thought it would be a good candidate for ...
4
votes
0answers
21 views

Inherit docstrings from specified parent

I was recently working on some python where I was working with multiple inheritance and mixins and stuff like that, and I wanted to inherit docstrings for specific functions, from specific parents (...
4
votes
0answers
49 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 ...
4
votes
0answers
48 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 ...
4
votes
0answers
28 views

Python automatic import and install script

In the following script, I am trying to infer if the modules are managed by a conda environment or not and based on that, I am trying to auto install and import the modules. [I skipped around 5 to 6 ...
4
votes
0answers
46 views

Asynchronous Stripe API and aiohttp parameters formatting

I'm testing the Stripe payment API. I couldn't find a Python wrapper that provides asynchronous requests so I'm writing one. My first goal was to implement the async equivalent of ...
4
votes
0answers
35 views

Python: Exception handling in a logic gate

I'm learning about Python and am going through the OO-stage where I'm building a set of logic-gate classes. To make the logic more resilient, I only want the user to be able to enter a value of 0 or ...
4
votes
0answers
80 views

Initial map modelling for Battleship game

The goal of the code below is limited to the creation of the initial map only and not to the whole game mechanics itself. The rules are that there are 4 ships of length {2,3,4,5} and no ship may be ...
4
votes
0answers
64 views

Game clock with configurable rate

Edit: Licensed source can be found here. The intent behind this class is to allow different game systems to run at their own clock rate. The physics integration rate should not be connected to the ...
4
votes
0answers
21 views

Construct intervals from a sequence of numbers and vice versa

What is a Pythonic way to construct intervals from a sequence of integer numbers? E.g. sequence [1, 2, 3, 6, 7, 9] could be converted to ...
4
votes
0answers
53 views

Basic Python HTTP Server

It's an extremely simply HTTP server in Python using the socket library, and a few others to get the MIME type, etc... I've also avoided the ../../ vulnerability, ...
4
votes
0answers
87 views

Decorate a python function to work as a Google Cloud Function

I wrote this for a class project, the backend for this dog voting website. I noticed duplicate code among multiple functions I was writing to be deployed as a cloud function: they all were wrapped in ...
4
votes
0answers
46 views

Convert Amazon transaction data for import into accounting system

At the end of each billing cycle, Amazon generates a raw transaction file for my store's orders that cycle. I am converting that raw transaction file into a .csv file to be imported into my accounting ...
4
votes
0answers
39 views

Iteratively Build a Summary Dataset in an Effective Way

This is a problem I find a lot!! Can I achieve this goal without consuming so much time? My code below achieves what I want it to achieve. However, I believe it could be a lot more efficient and ...
4
votes
0answers
195 views

dynwg: A DynDNS watchdog for WireGuard via systemd-networkd

Preface I'm using WireGuard as a VPN solution to connect a remote client permanently to my home server. Unfortunately due to Consumer DSL-related IP address changes, the client loses the connection ...
4
votes
0answers
64 views

Wrapping argparse to use configuration file

I want to be able to both provide options through command line and from a configuration file. A single option could be served either by the user or by the configuration. But if is provided by both, ...
4
votes
0answers
181 views

Pentominoes in Python

I'm currently coding a game of Pentominoes and I would like to hear suggestions on how to improve my code and make it more pythonic. Rules and goal of the game There is an 8x8 grid and you have 12 ...
4
votes
0answers
84 views

pool of python coroutines

Task control how much coroutines are running simultaneously with ability to stop the process from inside. Use case when scraping websites you want to control how much memory program consumes and ...
4
votes
0answers
579 views

Game of Life simulator, Python 3

Using Python 3.7.0, I've programmed a 'Game of Life' simulator. The output is displayed using tkinter. It's not meant to be limited to just Game of Life, though, as it's meant to also be used for a ...
4
votes
0answers
327 views

Tic Tac Toe engine in Python for Deep Learning

I'm implementing a Tic Tac Toe engine that will work with deep learning. I'm using a 3x3 numpy array of floats to represent the board. +1.0 represents an X, ...
4
votes
0answers
1k views

Implementation of binary search tree

I require a code review in terms of correctness, style consistency, efficiency, code readability, and "pythonic"ness. ...
4
votes
0answers
171 views

Distributed TensorFlow | VGG 16

I am trying to develop a VGG 16 model distributed over a single server. I have one available GPU server with 1 CPU and two GPU cards. I have the code to treat them as different servers and implement ...
4
votes
0answers
2k views

UDP chat program with server, client and listener

This is a little chat program that I have been working on and I want general feedback such as feature suggestions, efficiency comments, etc... The server will setup a DGRAM socket and constantly ...
4
votes
0answers
3k views

Minimal SQLite table view in PyQt5

I have just started digging into PyQt5 in order to write a small GUI for editing a lexical database. Before I dig deeper into this, I would like to have feedback on the progress so far. Some ...
4
votes
0answers
177 views

Ten Thousand: a dice game for multiple players v0.3

I've learned so much, how could I not come back for more? I think this is much improved. The only thing I have not implemented from Ten Thousand: a dice game for multiple players - follow-up is ...