Aller au contenu
View in the app

A better way to browse. Learn more.

Omerta

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

[ TUTO ] De la couleur dans le terminal

Featured Replies

Posté(e)

Salut 0,

aujourd'hui petit tuto sans prétention pour ajouter une touche de couleur à vos scripts python sans colorama.

En passant je vais vous partager ma classe de couleur.

 

Commençons par la classe en question : 
class CColor:
    Red = '\033[91m'
    Green = '\u001b[32m'
    Yellow = '\u001b[33m'
    Blue = '\u001b[34m'
    Cyan = '\u001b[36m'
    White = '\033[0m'

En gros j'utilise toujours celle là car même si elle est basique elle contient tout ce dont j'ai besoin.

/!\ SI VOUS FAITES VOTRE SCRIPT POUR WINDOWS TOUJOURS AJOUTER CA :

import os
os.system('color')

 

Ensuite pour l'utiliser je vous conseil de faire comme ça :

print(f'{CColor.Red}Ceci est rouge, {CColor.Green}ceci en vert et enfin {CColor.Yellow}ça en jaune. {CColor.White}Et retour à la normal')

Notez si vous ne connaissiez pas le f devant un string. Cela permet de concaténer des variables en les mettant dans des {}

Créer un compte ou se connecter pour commenter

Account

Navigation

Rechercher

Rechercher

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.