All Questions
19 questions
8
votes
1
answer
430
views
Printing Colored, CLId Unicode Chess Board - follow-up
Follow up to: Printing Command Line Unicode Chess Board
A couple people from the previous question mentioned looking into coloring the command line with ANSI escape sequences. In Python, ...
12
votes
3
answers
8k
views
Printing Command Line Unicode Chess Board
Let me preface this by detailing some of my design philosophy. The intent is to view the board from the perspective of the active player. Player moves are also factored into the design. When ...
6
votes
1
answer
231
views
Universal string conversion
Below there is a function eating all strings and convert it to Unicode. It works fine. But is it the best way to do so? Is there maybe already an existing function for it?
The reason was a German ...
9
votes
1
answer
170
views
Break text into letters (regular Unicode graphemes+language specific digraphs)
In English, "Sh" is two letters. In other languages it's considered a single letter. I'm trying to calculate the length of a string in a Unicode aware way, with this in mind. I'm imagining a function ...
18
votes
1
answer
6k
views
Pretty printing of the numpy ndarrays
Following this idea for pretty printing of numpy ndarrays, I have developed a very primitive prototype:
...
7
votes
1
answer
528
views
Subclassed Python Counter for a more visually user-friendly __str__() method, for anagrams
I wrote a Counter subclass suitable for anagrams, with a more visually user-friendly __str__() method using alphabetic ordering ...
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 ...
2
votes
0
answers
187
views
Removing text inside brackets [closed]
The following function removes text inside parenthesis, also checks for balanced brackets. Example:
RemoveTextInsideParenthesis('Yahoo (Inc)') will return ...
3
votes
1
answer
67
views
Preliminary draft of a data structure for a goodies tracker
My girlfriend and I are making a goodies tracker to enable us to keep better track of our stamp/gift cards. Right now we've got a super simple Object with some fields of what a stamp card has, and no ...
2
votes
1
answer
1k
views
Python script to scrape titles of public Youtube playlist
Just started in Python; wrote a script to get the names of all the titles in a public Youtube playlist given as input, but it got messier than it might have to be.
I looked around online and found ...
5
votes
1
answer
1k
views
Normalize a GSM short message text
I am working to improve this script, which should prepare a text to be sent as a GSM short message using only the GSM 7-bit character coding with Basic Character Set Extension.
...
4
votes
1
answer
8k
views
Converting HEX values to Unicode characters
I have a small bot for social network, which accepts message "unicode XXXX XXXX XXXX ...", where XXXX - HEX values which I ...
4
votes
2
answers
883
views
Extracting the first letter of a string
I'm extracting the first letter (not symbol) of a string using Unicode characters, with French words/sentences in mind.
I have implemented it like this:
...
8
votes
3
answers
445
views
Unicode Chess PvP with Move Validation
Main Purpose
This script allows two players to play chess on a virtual chessboard
printed on the screen by making use of the Unicode chess characters.
Visual appearence
...
3
votes
2
answers
282
views
Check that files don't contain Unicode
I use this code to check that all files in a directory are free from Unicode and non-printable characters.
Can I improve the structure of the code?
...