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.

Filter by
Sorted by
Tagged with
1
vote
0answers
8 views

Combining data to create a list

I am trying to create a list based on some data, but the code I am using is very slow when I run it on large data. So I suspect I am not using all of the Python power for this task. Is there a more ...
3
votes
1answer
26 views

Leetcode 957. Prison Cells After N Days

I am working on 957. Prison Cells After N Days but getting timeout error for my code. as I assume my code should be 14+O(n-14) about O(n) am I right since after 14 run pattern will be repeated? and ...
1
vote
0answers
23 views

Python selenium web scraping

Written following code to extract table form portal. The code works fine (except the net connectivity). But 1. I want to make it more simple, more flat. 2. If I can use explicit wait to avoid stale ...
1
vote
2answers
23 views

Track the existence of process

I have an api endpoint that, when called, initiates the generation of a report. This is time consuming process and response could come pretty late. So, we came up with caching architecture and once ...
1
vote
1answer
19 views

Part 2: Create or update record via HTTP request

This script was previously reviewed here: Part 1: Create or update record via HTTP request I've made the changes that were suggested by @Reinderien. Now that the code has been significantly refactored,...
1
vote
2answers
125 views

Python arbitrary objects Serialization and Deserialization

I am trying to convert objects inside an object(arbitrary objects) to Json and later retrieve it. I have developed some codes and would like to share if there is any problem in the code. ...
-1
votes
0answers
13 views

How to update a column in sql based on another table's last row, column value [closed]

I'm currently on the process of making a CRUD Database program. I'm having some trouble with the database. I would like to link 2 columns with each other. It's quite different from usual though, it's ...
-4
votes
0answers
18 views

How to add an interactive plot in Jupyter Notebook? [closed]

I have made a plot for the basic SIR model. I am satisfied with my plot, however, I would like to be able to have an interactive slider that tweaks my parameters beta and gamma. I would like both of ...
1
vote
0answers
40 views

Do I need to use inheritance and classes for my OOP webscraper?

I am currently writing python code that scrapes information from the web. I have to scrape several sites, but there a two types of procedures: Directly scrape from the website Download pdf and scrape ...
16
votes
3answers
2k views

Chess game for my students

I teach programming, and I currently teach my class about inheritance, abstract classes, and mixins. I wrote this code as an example, and I want to be sure it is as good as possible before I release ...
3
votes
0answers
22 views

Converting a graph to a directed graph with order of the nodes defined by post-order traversal

Background: I'm implementing an algorithm from the paper Polygon Area Decomposition for Multiple-Robot Workspace Division and one of the steps is to represent a polygon as a graph. This is done by ...
4
votes
1answer
50 views

Weather Forecast Web Application

I've made a Python Flask app and I have some questions about the structure of the main module (equivalent of index.py). Here is what it looks like: ...
-3
votes
0answers
37 views
8
votes
1answer
45 views

Red-Black Tree Implementation in Python

i'm wondering if there are better practices, and optimizations, i could make on my code, to do things easier/faster. I have added comments, in many places in the code, to make understanding easier. <...
5
votes
2answers
70 views

DNA Translator and Verifier (using BLAST)

Proteins are chains of amino acids. Amino acids are coded by codons, a sequence of 3 DNA/RNA molecules. DNA also has 3 open reading frames. This is basically the DNA sequence, but shift it by 1 (i.e. ...

15 30 50 per page
1
2 3 4 5
829