All Questions
8 questions
5
votes
1
answer
13k
views
Convert to UTF-8 all files in a directory
1. Summary
I can't find, how I can to refactor multiple with open for one file.
2. Expected behavior of program
Program detect encoding for each file in the ...
7
votes
1
answer
366
views
Wrapper to enhance a program to translate from LTL formulae to Büchi automata
The following is a script that is supposed to act as a wrapper for ltl2ba, a program which transforms LTL formulas into Buchi Automatons encoded in the Promela language. The wrapper adds a limited set ...
5
votes
1
answer
4k
views
Mapping a CSV with UTF-8 encoding to JSON in Python
I'm not a programmer, just a guy who needs to solve particular things using code.
I needed to create a JSON from a CSV with predefined headers. I'm downloading an attachment from JIRA (REST API), ...
12
votes
3
answers
5k
views
UTF-8 Validation
I've recently solved the "UTF-8 Validation" LeetCode problem:
A character in UTF8 can be from 1 to 4 bytes long, subjected to the
following rules:
For 1-byte character, the first bit is a 0, ...
2
votes
2
answers
348
views
Parsing and saving JSON result from GoEuro API
I am new to python so I decided to write a script that parses a json array and writes data in a file.
I wrote the code that does that but I think it can be done way better, So I was hoping to get ...
1
vote
1
answer
3k
views
Robustly dealing with malformed Unicode files
I'm writing a script that deals reads UTF-8-encoded XML files and writes parts of those files into a tempfile for further processing.
Sometimes, the input files will have a few malformed characters. ...
1
vote
1
answer
85
views
Avoiding use of .encode() in rss2html
My concern with this code is the excessive use of .encode('utf-8'). Any advice on refining these functions would be very helpful.
rss2html GitHub repo
...
8
votes
1
answer
21k
views
Splitting a CSV file with headers
I have been looking for an algorithm for splitting a file into smaller pieces, which satisfy the following requirements:
The first line in the original file is a header, this header must be carried ...