Giter Site home page Giter Site logo

abhijithaj / clrprint Goto Github PK

View Code? Open in Web Editor NEW
27.0 3.0 2.0 769 KB

Print colorful output in the terminal, idle, cmd, and Windows PowerShell using the same functions.

License: MIT License

Python 100.00%
colorprint idle terminal powershell python3 colors idle-colors cross-platform clrprint python

clrprint's Introduction

clrprint v2.0

Generic badge
made-with-python Generic badge PyPI license PayPal

  • Colorful output
  • Work's on IDLE, command prompt, windows powerShell, and terminal
  • Simply input() with clrinput() and print() with clrprint()
  • Basic colors only. Red, green, yellow, blue, purple, and black/white (default)
  • Flexible to print or take input only on demand (on DEBUG)
  • User input timeout feature (This is supported only on interactive shell)

ABOUT

This clrprint is developed to print a colorful output on idle, windows power shell and terminal. It has red, blue, green, yellow, purple and black/white (default) colors.

clrinput() includes a timeout feature that returns None if no user input is received within a certain amount of time.

It prints with default color if given color is not available.

Installation

You can install clrprint by running the following command

pip install clrprint

Usage

It's as simple as using Python's print() and input() functions.

Argument clr to represent color, debug to print only when debug=True are added.

clrinput() takes timeout argument that returns None if no user input is not received within a certain amount of time.

Note: timeout feature is not supported in IDLE. It is neglected by IDLE if it is passed

You can use clrhelp() to print out and see how to use it.

Example Code:

from clrprint import *

clrprint('text1','text2', clr='r')  # single letter is enough to represent color.
clrprint('text1_clr1','text2_clr2','text3_clr3','text4_clr4', clr='r,y,g') # prints 3 colors in same line
clrprint('ERROR:','error information','suggestions 1','suggestion2','suggestion3', clr='r,y,g') # print

#Supported on terminal, command prompt and powershell 
colord_text = clrit('text1', 'text2', clr='r,g') # returns ASCII coloured text
print(colord_text)
user_input = clrinput('Choose yes/no?', clr='r', timeout=10) or "DEFAULT"  # Take user input in 10 sec else Choose any Default value
print(user_input)

The input timeout functionality was inspired by WereCatf from the project werecatf

Screenshots

Terminal:

IDLE:

Powershell:

Example Code

'''
Developed by Abhijith Boppe - linkedin.com/in/abhijith-boppe/
'''
from clrprint import *

userclr = clrinput('Enter color: ',clr='green').strip()  # prompt color text
clrprint('You enterd', userclr,clr=userclr) # print it in that color

# If color not available it print's with default color (white/black)

# Input timeout and clrit (Works on terminal, cmd and powershell. Not supported on IDLE).
continue_ = clrinput('Continue FUZZING? :',clr='p', timeout=15) or False # if no user input in 15, take False
if continue_:
  FUZZ()
colored_text = clrit('Text1', 'Text2', clr='r,g') # Returns ASCII colored text 
clrhelp()  # to list out usage and available colors.

Buy Me A Coffee

License & copyright

© Abhijith Boppe, Security analyst

LinkedIn

© Dheeraj Kakkar, Software Developer

LinkedIn

Licensed under the MIT License

clrprint's People

Contributors

abhijithaj avatar kethan1 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.