Skip to main content

PyMsgPrompt is a python module to embed prompt functionality in your code. Current Version of the module is 1.1.1

Project description

PyMsgPrompt

PyMsgPrompt is a python module to embed prompt functionality in your code.

Version

The current version of this module is 1.1.1 and this is the first BETA release after last Alpha version 0.0.5, 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
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)
        time.sleep(0.01)

Below is the output,

[QUES] 2020-Oct-13 23:52:03: Do you want to close? (yesss/ no/ yes)[no]
no
Answer is no
[INFO] 2020-Oct-13 23:52:16: The message is 1

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

PyMsgPrompt-1.1.1.tar.gz (5.8 kB view details)

Uploaded Source

Built Distribution

PyMsgPrompt-1.1.1-py3-none-any.whl (6.3 kB view details)

Uploaded Python 3

File details

Details for the file PyMsgPrompt-1.1.1.tar.gz.

File metadata

  • Download URL: PyMsgPrompt-1.1.1.tar.gz
  • Upload date:
  • Size: 5.8 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

Hashes for PyMsgPrompt-1.1.1.tar.gz
Algorithm Hash digest
SHA256 f26fde61d7722de876e5a7adf70c28416774a11f6e43b3246ecbaf9d99b31b7f
MD5 69804e25289b103f26672f2baa59261b
BLAKE2b-256 e354b8f6ca5572d4e08c78981a7ac1546eb98ee3a53f0e83e463adc048788593

See more details on using hashes here.

File details

Details for the file PyMsgPrompt-1.1.1-py3-none-any.whl.

File metadata

  • Download URL: PyMsgPrompt-1.1.1-py3-none-any.whl
  • Upload date:
  • Size: 6.3 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

Hashes for PyMsgPrompt-1.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 fe1902b3518cb583869ccdb8f25b197b9c9e2d55e47b7618f210cd946bb4df57
MD5 98b2b729d81b80ae6bd5a26c9cd11948
BLAKE2b-256 3151578dfac5231427dca981e236140cb8dd791e951da304046cde17c830adcb

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page