PyMsgPrompt is a python module to embed prompt functionality in your code. Current Version of the module is 1.2.2
Project description
PyMsgPrompt
PyMsgPrompt is a python module to embed prompt functionality in your code.
Version
The current version of this module is 1.2.2
and this is the second BETA release after first BETA version 1.1.1
, however, you can run the below command to check the version of the module.
python -m pymsgprompt.version
Platform Supports
This is a cross platform module and supported both in python 2 and 3.
Installation
To install this module you can use clone with git or just simply run pip install command.
Using git
git clone https://github.com/antaripchatterjee/PyMsgPrompt.git
cd PyMsgPrompt
python setup.py install
Using pip
pip install pymsgprompt
Uninstallation
Uninstallation can be done by running pip uninstall command.
pip uninstall pymsgpropmt
Usage
To test this module, you can run the below simple code.
from pymsgprompt.prompt import ask, log
from pymsgprompt.logger import perror, pinfo, pwarn
import time
if __name__ == '__main__':
answer = ask('Do you want to close?', choices=['yes', 'no', 'yesss'], default='no', timestamp=True, regexp=True, ignore_case=False)
# with open('test.txt', 'w') as test:
# print (log('Answer is %s'%answer, logtype='error', timestamp=True, file=test))
if answer.startswith('n'):
log('Answer is %s'%answer, logtype='error', timestamp=False, reset=True)
else:
log('Answer is %s'%answer, logtype='info', timestamp=False, reset=True)
for i in range(1000, 0, -1):
log('The message is %d'%i, timestamp=True, end=None if i > 1 else '\n', reset=i==1)
time.sleep(0.01)
pinfo('I am a Python Developer')
pwarn('Some kind of warning message')
perror('Some kind of error message')
Below is the output,
[QUES] 2020-Oct-14 22:11:08: Do you want to close? (no/ yes/ yesss)[no]
no
Answer is no
[INFO] 2020-Oct-14 22:11:21: The message is 1
[INFO] 2020-Oct-14 22:11:21: I am a Python Developer
[WARN] 2020-Oct-14 22:11:21: Some kind of warning message
[ERROR] 2020-Oct-14 22:11:21: Some kind of error message
API Reference
A good documentation, specially for the developers, will be provided later.
Development Areas
I am already working on some other functionalities, which will be provided in the future releases.
License
This module is licensed under MIT License.
Contribution
Pull requests are always awesome, but please make sure of raising request, before making any changes.
Project details
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 PyMsgPrompt-1.2.2.tar.gz
.
File metadata
- Download URL: PyMsgPrompt-1.2.2.tar.gz
- Upload date:
- Size: 6.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/42.0.2 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.7.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | bd45f7372c5c63fc95eaa1d21f23ae4effb26aa4e9c0c682f868d641b436547c |
|
MD5 | 8c6a8fad0acdd891ed482ae4d03587a1 |
|
BLAKE2b-256 | 1e0d5f43f6a5d8a598797ec1d414d3faec0393eb4675502016078af8b8927664 |
File details
Details for the file PyMsgPrompt-1.2.2-py3-none-any.whl
.
File metadata
- Download URL: PyMsgPrompt-1.2.2-py3-none-any.whl
- Upload date:
- Size: 7.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/42.0.2 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.7.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4514afd686c99b0f5d0934ab4145cbaf7fe53e5e7c5cf0433e7564690ce33584 |
|
MD5 | 5f861a32a9996f0655b0a8d6db9b6948 |
|
BLAKE2b-256 | a6a1000aee45b96b7cfb35e78a064f3bfb4b76a71418fca19b04b0438c61edae |