All Questions
Tagged with parsingpython-3.x
88 questions
5votes
5answers
840views
Bracket matching - Advent of Code 2021 Day 10
The following code solves Advent Of Code 2021 Day 10. The goal for this time around is evaluating whether a line of brackets is complete, has a syntax error or is missing some closing brackets. ...
3votes
2answers
176views
Simple Python text file Parser and Converter
I wrote a simple text parser and a converter using Python 3.12.1. The purpose is to read a text file that contains 20000 words one per line, and create an output file that contains all the queries. ...
7votes
4answers
445views
Separating a String of Text into Separate Words in Python
Occasionally, we want to do a rudimentary parsing on English text; we separate the text into separate words. ...
5votes
1answer
196views
constraint solving graduation using HTML Parsing, pandas, and z3
not sure if this project fits on code review, but my code is getting extremely messy, and would love some tips to clean it up! Overview The project is designed to take in an HTML file (a degree audit),...
1vote
1answer
77views
Checking several strings against a n-depth list of lists and returning one if its values
The data structure I am working with is a list of lists that is created by parsing a file. The depth of the list can vary. The list can have n Strings before its child-value begins. My current example ...
4votes
1answer
290views
Processing lines of a file with various space-separated fields of strings, hex addresses, and integer addresses
I have a plain text file which contains lines with fields below: ...
2votes
1answer
73views
Improvement for parsing LTL grammer
I'm new here. I wrote the following code to parse the linear temporal logic(LTL) formula and evaluate it with respect to a trace. But I'm totally not happy with my code because I think the complexity ...
2votes
2answers
244views
Python function that parses a long string as key-value pairs for logging
I noticed I tend to use many if-conditions in my code, and I know there is a way to simplify this with one-liners. The function is iterating through configuration dictionaries so that I can log ...
2votes
2answers
124views
Regex and pandas to read forecast sky condition string
DataFrame methods to parse the sky condition from a terminal aerodrome forecast. A line in a taf can report zero-eight cloud layers. Cloud layers are required in predominate lines, and optional in ...
10votes
1answer
2kviews
Python script to analyse Apache log files
I am fairly new to Python programming language. Most of python programmers have heard the philosophy behind the python programming language. The code should be easy to read, easy to understand, simple,...
2votes
1answer
555views
Boolean expression evaluation for user input using evil eval
The following code is a module that evaluates boolean expressions, which are entered through an unauthorized web API. The exposed function of the library being used is ...
3votes
0answers
87views
Advent of Code 2021: day 10- Syntax Scoring
The following code solves day 10 in the advent of code challenge. The goal for this time around is evaluating whether a line of brackets is complete, has a syntax error or is missing some closing ...
3votes
3answers
548views
Find the average score, given data in a table with labeled columns not in a fixed order
I was on Hacker Rank for the first time and there was a question that required to get the inputs from STDIN and use collections.namedtuple(). It was my first time ...
4votes
2answers
277views
i3 config file parser
So I am using i3 an Linux window manager to manage my windows. In addition this is run on a laptop that is frequently mounted to several output-displays. This is handled by the following lines in my ...
3votes
0answers
80views
Python program that analyzes a corpus for randomword generation
I play a lot of old-school western CRPGs, and most of them (if not all) require the player to generate an avatar at the start of a new game, including naming the character (with names that will never ...