This example demonstrates how to use the cross-platform path utilities provided by :mod:`libp2p.utils.paths`.
After installing py-libp2p (pip install -e . from a checkout, or pip install libp2p), you can run the demo as a console script or as a module:
$ python -m pip install libp2p
Collecting libp2p
...
Successfully installed libp2p-x.x.x
$ path-handlingFrom a source checkout you can also run:
$ python -m examples.path_handling.path_handling_demoThe full source code for the implementation is below:
.. literalinclude:: ../examples/path_handling/path_handling.py
:language: python
:linenos:
.. automodule:: examples.path_handling.path_handling :members: :show-inheritance: :undoc-members:
.. automodule:: examples.path_handling.path_handling_demo :members: :show-inheritance: :undoc-members:
.. automodule:: examples.path_handling :members: :show-inheritance: :undoc-members: