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.1.0.tar.gz
(2.7 kB
view hashes)
Built Distribution
Close
Hashes for pybites_pysource-1.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 13778c2f8a7110b3d9b288fbe098d9e23ac26d21f871f34559678d6d30077ebe |
|
MD5 | c1b7769bc502a95d5613a354f9fc4db3 |
|
BLAKE2b-256 | e3a1223192d4f3592b7111169480908a8a3d855bab348310fcc7f192538a0601 |