OPENSOURCE_FINDINGS Telegram 909
В Python3.14 добавили подсветку синтаксиса в новом PyREPL

- PR: https://github.com/python/cpython/pull/133247

Выглядит прикольно. А еще можно делать свои темы, вот пример дефолтной:


theme = {
"PROMPT": colors.BOLD_MAGENTA,
"KEYWORD": colors.BOLD_BLUE,
"BUILTIN": colors.CYAN,
"COMMENT": colors.RED,
"STRING": colors.GREEN,
"NUMBER": colors.YELLOW,
"OP": colors.RESET,
"DEFINITION": colors.BOLD,
"SOFT_KEYWORD": colors.BOLD_BLUE,
"RESET": colors.RESET,
}


Свою можно поставить так:

1. Меняем цвета для тех токенов, которые хотим подсветить. Складываем в импортируемый модуль. Например: your_theme

2. При старте – устанавливаем свою тему


export PYTHONSTARTUP='import _colorize; from your_theme import theme; _colorize.set_theme(theme)'


Доки про PYTHONSTARTUP: https://docs.python.org/3/using/cmdline.html#envvar-PYTHONSTARTUP

Вот тут реализация подсветки, она довольно простая.

Ждем реализацию pustota для PyREPL?

| Поддержать | YouTube | GitHub | Чат |
👍84🔥36🤡87🤩2



tgoop.com/opensource_findings/909
Create:
Last Update:

В Python3.14 добавили подсветку синтаксиса в новом PyREPL

- PR: https://github.com/python/cpython/pull/133247

Выглядит прикольно. А еще можно делать свои темы, вот пример дефолтной:


theme = {
"PROMPT": colors.BOLD_MAGENTA,
"KEYWORD": colors.BOLD_BLUE,
"BUILTIN": colors.CYAN,
"COMMENT": colors.RED,
"STRING": colors.GREEN,
"NUMBER": colors.YELLOW,
"OP": colors.RESET,
"DEFINITION": colors.BOLD,
"SOFT_KEYWORD": colors.BOLD_BLUE,
"RESET": colors.RESET,
}


Свою можно поставить так:

1. Меняем цвета для тех токенов, которые хотим подсветить. Складываем в импортируемый модуль. Например: your_theme

2. При старте – устанавливаем свою тему


export PYTHONSTARTUP='import _colorize; from your_theme import theme; _colorize.set_theme(theme)'


Доки про PYTHONSTARTUP: https://docs.python.org/3/using/cmdline.html#envvar-PYTHONSTARTUP

Вот тут реализация подсветки, она довольно простая.

Ждем реализацию pustota для PyREPL?

| Поддержать | YouTube | GitHub | Чат |

BY Находки в опенсорсе




Share with your friend now:
tgoop.com/opensource_findings/909

View MORE
Open in Telegram


Telegram News

Date: |

It’s easy to create a Telegram channel via desktop app or mobile app (for Android and iOS): Judge Hui described Ng as inciting others to “commit a massacre” with three posts teaching people to make “toxic chlorine gas bombs,” target police stations, police quarters and the city’s metro stations. This offence was “rather serious,” the court said. Avoid compound hashtags that consist of several words. If you have a hashtag like #marketingnewsinusa, split it into smaller hashtags: “#marketing, #news, #usa. The group also hosted discussions on committing arson, Judge Hui said, including setting roadblocks on fire, hurling petrol bombs at police stations and teaching people to make such weapons. The conversation linked to arson went on for two to three months, Hui said. Over 33,000 people sent out over 1,000 doxxing messages in the group. Although the administrators tried to delete all of the messages, the posting speed was far too much for them to keep up.
from us


Telegram Находки в опенсорсе
FROM American