{ "info": { "author": "Sayad Pervez", "author_email": "pervez2504@gmail.com", "bugtrack_url": null, "classifiers": [ "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python :: 3" ], "description": "# Color_Console Max-Loaded\n#### This module is used to change the color of text and background of the python console designed for *Windows Operating System.*\n___\n___\n# What's New ?\n### => Easier importing of functions.\n### => Functions updated to work with Dictionaries.\n### => 4 more functions added.\n### => Automatic package installation for unavailable libraries.\n### => Arguements are Case Insensitive.\n### => Increased error tolerance.\n___\n___\n# Importing Functions:\n#### `from Color_Console import *` statement is used to import all necessary functions from Color_Console module.\n### This version contains the following functions which we'll be discussing shortly.\n#### $ __color()__\n#### $ __ctext()__\n#### $ __transTime()__\n#### $ __hackerMan()__\n#### $ __help()__\n___\n___\n# Color()\n#### **`color()`** is used to change the text color and background color of the whole python console.\n#### **`color ( text = \"bright white\" , bg = \"black\" , delay = 0.67 ,repeat = -1 , dict = {} )`** is the function header.\n#### **`text`** is used to specify the color of the text.\n#### **`bg`** is used to specify the color of the background.\n## The permitted colors are:\n#### 1. *Black*\n#### 2. *Blue*\n#### 3. *Green*\n#### 4. *Aqua*\n#### 5. *Red*\n#### 6. *Purple*\n#### 7. *Yellow*\n#### 8. *White*\n#### 9. *Gray*\n#### 10. *Light Blue*\n#### 11. *Light Green*\n#### 12. *Light Aqua*\n#### 13. *Light Red*\n#### 14. *Light Purple*\n#### 15. *Light Yellow*\n#### 16. *Bright White*\n\n### **None of the arguements are case sensitive. Text color and background color cannot be the same.**\n___\n#### If a _**list**_ of permitted colors is passed to either **`text`** or **`bg`**, the colors change in accordance to their position in the list.\n```python\n# Constant background color with altering text color:\nli = [ 'black','bright white' ]\nprint(\"Hello World !\")\ncolor( li , 'aqua' )\n# This will make the text color of the console change to black and bright white alternatively and indefinitely\n# with it's background color set to aqua\n```\n```python\n# Constant text color with altering background color:\nli = [ 'black','bright white' ]\nprint(\"Hello World !\")\ncolor( 'aqua' , li )\n# This will make the background color of the console change to black and bright white alternatively and indefinitely\n# with it's text color set to aqua\n```\n___\n#### **`delay`** parameter is used to specify the time between two transitions. The **default value is set to 0.67 seconds** which can be changed.\n```python\n# Changing color transition time:\nli = [ 'black','bright white' ]\nprint(\"Hello World !\")\ncolor( 'aqua' , li , delay = 1 )\n# and hence the color transition would take 1 second.\n```\n___\n#### **`repeat`** parameter is used to specify the number of times the list of colors has to be repeated. The **default value is -1** which makes the color transition occur indefinitely. Note that if color transition is set to indefinite, the program will not move further ( The code next to it will not be executed ! ). **`repeat`** parameter would allow the code to proceed once the list is iterated the given number of times. Time taken for this is dependent on both **`delay`** and **`repeat`**.\n```python\n# repeating the color transition only certain number of times\nli = [ 'black','bright white' ]\nprint(\"Hello World !\")\ncolor( 'aqua' , li , delay = 1 , repeat = 2 )\n# The transition will be repeated two times with a time delay of 1 second each and hence would take 4 seconds\n# since the number of elements in the list is 2.\n```\n#### Total time required to complete transition can be found out by using **`transTime()`** which will be explained later.\n#### **`delay`** and **`repeat`** are optional parameters.\n___\n\n#### When the parameters of both \"text\" and \"bg\" are lists, the color transition is as follows:\n```python\n# When both text and bg recieve arguements that are of list type,\n# the corresponding text and bg colors are used as they are iterated\nprint(\"Hello World\")\ncolor( ['green','blue'] , ['black','bright white'] )\n# This would result in a console with the following text and bg color which repeats indefinitely\n# green text color with black as bg color\n# blue text color with bright white as bg color\n```\n#### **Note that if the size of two lists are different, an error will be thrown.**\n___\n#### A dictionary with valid color combinations can be passed to **`dict`** to get an output similar to the previous one using two lists.\n```python\n# Passing dictionary to color()\nDictionary={\n'green' : 'black' ,\n'blue' : 'bright white'\n}\ncolor( dict = Dictionary )\n# This output is similar to the previous one.\n```\n#### **Limitations in passing a dictionary:**\n#### A color in the key cannot be present in the value. So Don't mix the keys and values in a dictionary.\n#### _Reminder:_ *`dictionary ={ key1 : value1 , key2 : value2 }`* _Dictionary consists of key:value pairs_\n```python\nDictionary={\n'green' : 'black' ,\n'black' : 'bright white'\n}\nprint(\"Hello World\")\ncolor( dict=Dictionary )\n# This code would throw an error since 'black' is both in keys and values of the dictionary.\n```\n```python\nDictionary={\n'red' : 'bright white',\n'black' : 'bright white'\n}\nprint(\"Hello World\")\ncolor( dict=Dictionary )\n# This code wouldn't throw an error since 'bright white' is only values and not in keys of the dictionary.\n```\n### **Thus repetition of colors is allowed but intermixing of keys and values of a dictionary are not permitted!**\n___\n___\n# ctext()\n#### **`ctext()`** is used to change the text and background color of only one line in the python console.\n#### **`ctext( String , text = \"white\" , bg = \"black\" , delay = 0 , repeat = 1 , dict = {} )`** is the function header.\n#### **`String`** is used to send the required string to be colored.\n#### **`text`** is used to specify the color of the text.\n#### **`bg`** is used to specify the color of the background.\n___\n## The permitted colors are:\n#### 1. *Blue*\n#### 2. *Green*\n#### 3. *Red*\n#### 4. *Magenta*\n#### 5. *Yellow*\n#### 6. *White*\n#### 7. *Cyan*\n#### 8. *Black* **only for background**\n### **None of the arguements are case sensitive. Text color and background color cannot be the same.**\n___\n> **Note:**\n> _**`ctext()`** **requires two modules namely** **`colorama` and `termcolor`** **to work.\n> Whenever you run ctext, the presence of these two modules are verified and imported automatically. If absent these two modules are automatically installed via pip. In such a case, good internet connection is recommended. If the installation process fails even in the presence of internet(the program will notify you!), try installing these two modules via pip manually.**_\n___\n## Similarities between ctext and color:\n#### **Parameters like `text`, `bg`, `delay`, `repeat` and `dict` work in a similar manner with slight exceptions which will be discussed later.**\n___\n## Exceptions:\n#### **`String`** parameter takes a string as an arguement and this line alone is printed with different colors as instructed by text and bg parameters. Passing a string alone to **`ctext()`** would be similar to **`print()`** statement.\n#### **`String` parameter is a mandatory one and should not be omitted\"**\n```python\nctext(\"Hello World\",\"Green\",'white') # This would affect only this line unlike color()\nctext(\"Hello World\") # This statement is similar to print()\n```\n___\n#### **The permitted colors are different for `color()` and `ctext()` and they were already mentioned above**\n___\n#### **`delay`** refers to the time between printing consecutive statements in a list. When a list is passed to text or bg, the **`String`** is printed in the respective colors one after the other depending on **`repeat`** parameter. The default value of **`delay`** is set to **0 units** and **`repeat`** is set to **1**\n___\n___\n# transTime()\n#### **`transTime`** is used to find the total time required to complete all color transitions. Only after all the transitions are complete, the code following **`color()`** or **`ctext()`** will be executed.\n#### **`transTime( n , delay , repeat , print = True )`** is the function header.\n#### Either the 'number of colors in the list or dictionary' or 'the list and dictionary itself' can be passed to **`n`**.\n#### **`delay`** parameter takes the delay value you are planning to use.\n#### **`repeat`** parameter takes the delay value you are planning to use.\n#### This function both prints and returns the total transition time. Not using the return value will not throw an error.\n#### **`print`** is an optional parameter which is set to True by default. If this is changed to False, **`transTime()`** would only return a value and not print anything on the console.\n```python\nDictionary = {\n'red' : 'bright white',\n'black' : 'bright white'\n}\nli = ['red' , 'black']\nnumber_of_elements = 2\ntransTime(Dictionary,1,3)\ntransTime(li,1,3)\ntransTime(number_of_elements,1,3)\n# All this will result in the same output \"Total time required = 6 units\" and return 6\ntime = transTime(li,1,3,print=False) # This will only return a value and not print anything else\nprint(time) # This would print \"6\"\n```\n___\n___\n# hackerMan()\n#### This function is added just for fun in case if you wish to look like a hacker amongst your friends.\n#### This would make the text color 'green' and background 'black'.\n#### This takes no arguements. Just add this function at the beginning of your program !\n```python\nhackerMan()\nprint(\"ipconfig /flushdns\")\nprint(\"ping www.google.com\")\nprint(\"tracert www.google.com\")\nprint(\"bruteForce -library='n10' someone's_mail@gmail.com\")\n# All these statements will be printed in green with black background.\n```\n___\n___\n# help()\n#### **`help()`** will provide you the same information in a python console offline\n#### **`help( c = True )`** is the function header.\n#### If you use **`help()`** the text and background will start changing automatically based on a predefined instruction of colors after 30 seconds. If you find it disturbing, you can use **`help(False)`** to shut down the color transitions and display instructions in default color.\n___\n___\n# Developed by SAYAD PERVEZ\n# Email-Id : pervez2504@gmail.com\n___\n___\n\n\n", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/SayadPervez/Color_Console", "keywords": "", "license": "", "maintainer": "", "maintainer_email": "", "name": "Color-Console", "package_url": "https://pypi.org/project/Color-Console/", "platform": "", "project_url": "https://pypi.org/project/Color-Console/", "project_urls": { "Homepage": "https://github.com/SayadPervez/Color_Console" }, "release_url": "https://pypi.org/project/Color-Console/10.0/", "requires_dist": null, "requires_python": "", "summary": "Comprehensive Utility Library for changing the color of text and background of a python console.", "version": "10.0" }, "last_serial": 5304487, "releases": { "0.6": [ { "comment_text": "", "digests": { "md5": "47622d82ce57cdd7e54262cc5ca7be1d", "sha256": "37f9fe92360d88df491873e71e686da36fed117174a1ca636277d50b970e2b5b" }, "downloads": -1, "filename": "Color_Console-0.6-py3-none-any.whl", "has_sig": false, "md5_digest": "47622d82ce57cdd7e54262cc5ca7be1d", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 6215, "upload_time": "2019-05-21T05:50:00", "url": "https://files.pythonhosted.org/packages/4d/a5/561577570056dbb4768d6327be9e2dfaf6ea60dff8788099b2370bfcb53e/Color_Console-0.6-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "b40af3c3e777b9360b4722b2ae756c5e", "sha256": "61a615147623de83536e6cb0b039848944c56e8eea5e1795bf0a102715eec82b" }, "downloads": -1, "filename": "Color_Console-0.6.tar.gz", "has_sig": false, "md5_digest": "b40af3c3e777b9360b4722b2ae756c5e", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4004, "upload_time": "2019-05-21T05:50:01", "url": "https://files.pythonhosted.org/packages/76/3f/4cc35a77187f869d7987c0d77c937db00ac9a65bdd38b2a9c2bda71486c7/Color_Console-0.6.tar.gz" } ], "10.0": [ { "comment_text": "", "digests": { "md5": "c821375d8d8a8cd9662f0335395e9b1e", "sha256": "3c3ae71f848ae268a9a319007fd803f6aef3fb83dfe9b9b30ed90435947e11c3" }, "downloads": -1, "filename": "Color_Console-10.0-py3-none-any.whl", "has_sig": false, "md5_digest": "c821375d8d8a8cd9662f0335395e9b1e", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 11421, "upload_time": "2019-05-22T12:38:09", "url": "https://files.pythonhosted.org/packages/81/9b/647fc405d2f5a9b2f8fc099c20958a159cc381e3b956c07aaf46c41631d0/Color_Console-10.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "d9452b37b5fc52ead1fa6be516e7edcc", "sha256": "a8398a091b695dd171cd54b5e6285216d61228448b1e2439173aa765bd783b62" }, "downloads": -1, "filename": "Color_Console-10.0.tar.gz", "has_sig": false, "md5_digest": "d9452b37b5fc52ead1fa6be516e7edcc", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8313, "upload_time": "2019-05-22T12:38:11", "url": "https://files.pythonhosted.org/packages/27/21/8a1ee43786699a76e42d480db62a96809a75024aaaf3aa25ae3a0c4b9f67/Color_Console-10.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "c821375d8d8a8cd9662f0335395e9b1e", "sha256": "3c3ae71f848ae268a9a319007fd803f6aef3fb83dfe9b9b30ed90435947e11c3" }, "downloads": -1, "filename": "Color_Console-10.0-py3-none-any.whl", "has_sig": false, "md5_digest": "c821375d8d8a8cd9662f0335395e9b1e", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 11421, "upload_time": "2019-05-22T12:38:09", "url": "https://files.pythonhosted.org/packages/81/9b/647fc405d2f5a9b2f8fc099c20958a159cc381e3b956c07aaf46c41631d0/Color_Console-10.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "d9452b37b5fc52ead1fa6be516e7edcc", "sha256": "a8398a091b695dd171cd54b5e6285216d61228448b1e2439173aa765bd783b62" }, "downloads": -1, "filename": "Color_Console-10.0.tar.gz", "has_sig": false, "md5_digest": "d9452b37b5fc52ead1fa6be516e7edcc", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8313, "upload_time": "2019-05-22T12:38:11", "url": "https://files.pythonhosted.org/packages/27/21/8a1ee43786699a76e42d480db62a96809a75024aaaf3aa25ae3a0c4b9f67/Color_Console-10.0.tar.gz" } ] }