Skip to main content

Useful debugging tools.

Project description

# python-debug

Useful debugging tools

## Installation

pip install python-debug

## Save text to temp file

>>> text = 'Lorem ipsum dolor sit amet, consectetur adipiscing elit...'
>>> import pydebug
>>> pydebug.save(text)
'/tmp/tmpSTTRow'

## Use less from python console

>>> text = 'Lorem ipsum dolor sit amet, consectetur adipiscing elit...'
>>> import pydebug
>>> pydebug.less(text)

## Use ack-grep from python console

>>> text = 'Lorem ipsum dolor sit amet, consectetur adipiscing elit...'
>>> import pydebug
>>> pydebug.grep(text, '-i lorem')
Lorem ipsum dolor sit amet, consectetur adipiscing elit...

## XML formatting

>>> xml = u'<data><item>hellow world</item></data>'
>>> import pydebug
>>> pydebug.xmlprint(xml)
<settings>
  <a>hellow world</a>
</settings>

## Display readable unicode strings in iterable object

>>> data = [u'лимон', u'апельсин', {u'фрукты':(u'мандарины',)}]
>>> print data
[u'\u043b\u0438\u043c\u043e\u043d', u'\u0430\u043f\u0435\u043b\u044c\u0441\u0438\u043d', {u'\u0444\u0440\u0443\u043a\u0442\u044b': (u'\u043c\u0430\u043d\u0434\u0430\u0440\u0438\u043d\u044b',)}]
>>> pydebug.uprint(data)
["лимон", "апельсин", {"фрукты":("мандарины",),},]
>>> pydebug.pprint(data)
[u'лимон',
 u'апельсин',
 {u'фрукты': (u'мандарины',)}]
>>>

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Filename, size & hash SHA256 hash help File type Python version Upload date
python-debug-0.1.3.tar.gz (2.6 kB) Copy SHA256 hash SHA256 Source None Sep 18, 2012

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page