Read Python source code from the command line
Project description
PyBites Pysource
A command line tool to read Python source code.
Installation
You can install pybites-pysource
from PyPI:
pip install pybites-pysource
This tool uses Python 3.x
Usage
You can use pybites-pysource
:
-
From the command line
$ pysource -m re.match def match(pattern, string, flags=0): """Try to apply the pattern at the start of the string, returning a Match object, or None if no match was found.""" return _compile(pattern, flags).match(string)
To show the resulting code with paging call
pysource
with-p
. -
From within Vim by selecting a
module.callable
adding this to your.vimrc
:`autocmd FileType python map <leader>py :exec '!python3.9 $HOME/bin/pysource.py -m <C-R><C-A> -p'<CR>`
Check out our blog post for a demo.
Tests
To run the tests:
$ python setup.py test
See: Integrating with setuptools / python setup.py test / pytest-runner.
Enjoy!
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
pybites-pysource-1.0.0.tar.gz
(2.6 kB
view hashes)
Built Distribution
Close
Hashes for pybites_pysource-1.0.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 90f1daa41a84850cf34f181048e20a82dae853c0010253071361038b94fb45a8 |
|
MD5 | 9e1e9cdfb74064adfcaefa90aac2f6dc |
|
BLAKE2b-256 | 2c3ccd118f034636f9d944a729e5bd3887bf808154f50c6b9436ef49797e9d6c |