python-3.x's questions - English 1answer

2.348 python-3.x questions.

This is my solution to the Chapter 9 exercise in Automate the Boring Stuff: Selective Copy Write a program that walks through a folder tree and searches for files with a certain file extension ...

So I programmed 2048 in python3 and a simple solver, which will just target a high numbers on the board (not the best tactic, I know), but I have the problem, that this move calculation is painfully ...

Description You and your friends are seizing another summer day, passing around the frisbee in the park. You have the most fun when the game is fair, so as much as possible, you would all like to ...

I have just started using pytest and I am still getting used to how they do things. It seems like fixtures are at the core of the library, and that they can be used for making small pieces of dummy ...

I moved to Python today after doing a little of c++. The following code works as intended, but I want to know if I should add the if __name__ == "__main__" ...

References Using those references: rolling median implementations benchmark FAST RUNNING MEDIAN USING AN INDEXABLE SKIPLIST Calculate the median of a billion numbers Find running median from a ...

Given an integer number of seconds, return a string which represents in human readable format the number of days/hours/minutes/seconds that are equivalent. ...

I am learning about the tree traversal, and I would like to ask for feedback. Using recursion, write a function that takes in a binary search tree and number of outputs a list of values ordered by ...

This is a non-deterministic finite state automata (NFA) meant to be used with a Regex engine. To show some example usage, suppose you wanted to construct an NFA for the regex ...

I have been playing around in hacker rank with Python these days, and now pulling my hair out on this question to solve the Euler's problem in the least time required. If we list all the natural ...

I am trying to insert the Dataframe which looks like this ...

I have census data that looks like this ...

Project Euler Problem 23 A perfect number is a number for which the sum of its proper divisors is exactly equal to the number. For example, the sum of the proper divisors of \$28\$ would be \$1 + 2 ...

What I Found I stumbled upon this python method: ...

My program evaluates fastq files. The fastq file is just a huge text file (about 1,5gb in my case), which looks like this: ...

I'm very new to python (been coding for about two days) and have created a programme that simulates blackjack games so that I can work out optimal strategy over many iterations. The problem is that ...

I needed to create a JSON file from a couple of MySQL tables to migrate some recipes from wordpress. This was my first time writing a script in python and would like to get some feedback on what I ...

I got this program that I am working on and in it, I got a section that has a try statement and two error except statements. ...

I have written a function that evaluates a contour integral in Python (Poincaré - Hopf index for 2D vector fields). It works, however is really slow if the arg res=N...

I want to go more in depth, but this is the 'boilerplate'. Is there any way I can optimize this or use more idiomatic Python code? ...

I am coming from a Ruby background and I am learning Python. This is a method I've created to generate a URL safe unique key: ...

I have around 300 log files in a directory and each log file contains around 3300000 lines. I need to read through each file line by line and count how many hostnames that appear on each line. I wrote ...

I wrote this program in Python 3.I would like to know if there is some more functionality that could be added/removed/is missing.Any comments would be helpful! ...

2048 style game

2 answers, 66 views python python-3.x 2048
I have made a replica of the game 2048. It works exactly how the game should work. However I was just looking to know where I could've possibly cleaned up my code or make it more efficient. ...

Wrote a simple script to implement Linear regression and practice numpy/pandas. Uses random data, so obviously weights (thetas) have no significant meaning. Looking for feedback on Performance Python ...

I have 40 CSV files, each containing ~6 million rows, and 2 columns. The columns are account_id and account_balance. The ...

I just submitted a Python solution to the 'Two Sum' problem on LeetCode. The Problem Given an array of integers, return indices of the two numbers such that they add up to a specific target. ...

I'm making a sort of a user interface for a telegram bot and my idea was to use State design pattern for making sort of a wizard for all the process, with user inputting data in each step or pressing /...

I need a script in python 3 to have all combinations of 10 characters from these characters: 0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ. (fr)J'ai besoin d'un script en python 3 pour avoir toutes les ...

I wrote this program in Python 3.I would like to know if there is some more functionality that could be added/removed/is missing.Any comments would be helpful! ...

I've created a basic Python CLI script, which takes a Github username, and returns some basic information associated with said username. I use the requests for HTTP requests (I'm new to this area) and ...

Inputs looks like this b inc 5 if a > 1 a inc 1 if b < 5 c dec -10 if a >= 1 c inc -20 if c == 10I am concerned that I need to declare ...

Problem: Write a function that takes a positive integer and returns the next smaller positive integer containing the same digits. My solution: ...

I've wrote this code and it does what is expected. However, I'm thinking if there are better ways to write this, specially if is useful to wrap it in a class, or other ways to make it less loosen. I'...

Interrogating a web API using query-url's, for each query I can get either zero hits, one hit, or multiple hits. Each of those categories needs to go into a separate CSV file for manual review or ...

I implemented the Shunting-yard algorithm in Python, I have experience in C# but I'm looking for comments making this more pythonic. I'm also be interested if these methods would be better as ...

I wrote a library implementing the RCON protocol to automate interaction with Minecraft servers. I know that there are already a couple of implementations out there, but neither I found was convincing ...

This is a follow-up to Searching online English dictionaries: ...

After posting here before, reading that advice, and doing some research, I re-planned and started over. I appreciate the comments I get here at Code Review. The first thing I did was to create a ...

I'm currently learning python / network programming altogether and I coded this simple python reverse shell; I would like to hear any remarks from you regarding code structure, any common beginner ...

I'm very new to python and programming in general. For a school assignment, I made this Memory Game and would love to receive feedback from you guys. ...

I implemented a password field based on the peewee framework to handle passwords of accounts in web applications for Python 3.4. My goals were Secure hashing. No plain password leakage. Easy ...

Outline: This code uses the Split function to extract specific information from the following website: https://www.webscraper.io/test-sites/tables. The required ...

I want to efficiently calculate Spearman correlations between a Numpy array and every Pandas DataFrame row: ...

I have the following Python output class that I'm planning to use across a number of modules in a terminal application: ...

Problem I'm writing a verilog program that does the trapezoidal integration method (where a review is also welcome, wink wink). But turns out you need input for these kind of things, so in the overly ...

I implemented a context manager to handle temporary files and directories. ...

Am I commenting enough? Are my variables properly following correct styling format? Is there a more efficient way to code my "Label coloring" conditions? ...

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 ...

Given the CSV data:,fan1,fan2,foil1,foil2 0,0.0,0.0,0.0,0.125 1,0.0625,0.0,0.0625,0.125 2,0.0625,0.0,0.0,0.3125Which I want to turn into a kind of annotated ...

Related tags

Hot questions

Language

Popular Tags