Skip to main content

All Questions

Tagged with
Filter by
Sorted by
Tagged with
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, ...
T145's user avatar
  • 3,149
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 ...
T145's user avatar
  • 3,149
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 ...
Cutton Eye's user avatar
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 ...
user avatar
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: ...
Foad's user avatar
  • 369
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 ...
smci's user avatar
  • 393
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 ...
Саша Черных's user avatar
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 ...
gogasca's user avatar
  • 609
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 ...
cody.codes's user avatar
  • 1,975
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 ...
Honest Escape's user avatar
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. ...
M.A.K. Simanto's user avatar
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 ...
MaxLunar's user avatar
  • 143
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: ...
Laurent LAPORTE's user avatar
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 ...
Caridorc's user avatar
  • 28k
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? ...
Jonas's user avatar
  • 31

15 30 50 per page