a small toolkit of functions i use
Project description
mptc
Matt's Python Tool Chain
Functions:
tts(text, lang, slow, p, warnings) uses GTTS to create and play google text to speech in 1 line) text: The text to say lang: The language passed to gTTS slow: When true it slows the speech down p: Should it print the line also warnings: if gTTS/playsound are not installed should it print a warning
ct(text,color,fe=5,p=False) colour text text: The text you want to colour colour: The colour (ansi code, eg: 1 = red 2 = green) fe: font effect (ansi code) p: should the function print the text
tPrint(Text) print with carriage return
clear() clear output on all OS
loading_bar(c=10, dm="Done", tick=True, pct=0, s=1, p=False) coloured loading bar c: colour dm: Done Message tick: whether to assign progress to a loop that ticks on a delay set by s pct: the percentage of the bar you wish to create if not using tick s: the delay of tick p: should the function print the loading bar or not
load_wheel(string="Please wait ..", c=None, i=0, Anim, delay=.5, cm=False): loading widget string:String to preceed the widget c: ansi colour i: which character of the animation to display Anim: a list of characters that when played in sequence form an animation delay: built in delay in seconds cm: string for after the widget
Premade Anims: spin, bubble, arrow
demo() demos the module
Classes:
Colour(r,g,b,a) r: red g: green b: blue a: alpha
Colour.invert() returns inverted colour
Example:
purple = mptc.Colour(90,0,90,255)
print(purple.r) or print(purple.red) both output 90
print(purple.g) outputs 0 print(purple.b) outputs 90
print(purple.a) outputs 255
print(purple.combined) outputs [90,0,90,255]
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file mptc-0.2.0.tar.gz
.
File metadata
- Download URL: mptc-0.2.0.tar.gz
- Upload date:
- Size: 15.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.6.1 requests/2.25.0 requests-toolbelt/0.9.1 tqdm/4.55.0 CPython/3.9.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6477d2cdc396ae0e1a020bfc90e1eed69a184e255f8dfc2c245dc97992ce4047 |
|
MD5 | 0442433a37824a0e0f539029c37aa356 |
|
BLAKE2b-256 | 3368c5f379793e0f84aaa52953c78b28fc7052380c0d0ea796315fe96e57e442 |
File details
Details for the file mptc-0.2.0-py3-none-any.whl
.
File metadata
- Download URL: mptc-0.2.0-py3-none-any.whl
- Upload date:
- Size: 16.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.6.1 requests/2.25.0 requests-toolbelt/0.9.1 tqdm/4.55.0 CPython/3.9.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 99099002ab7d9c01211592c4f7cd6fd0e8eb4502d9821cb1cda023ee1c1f1ac0 |
|
MD5 | a6bd8b3a4b2c096891bd6395431e69c8 |
|
BLAKE2b-256 | 2feb9d9bceb7d41c54fc59d4d45af0a0b818b5aa8a7efb99d1d42b2dda8e2958 |