You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Conception/drake-master/bindings/pydrake/tutorials.py

37 lines
1.2 KiB

"""Drake offers Python tutorials that can be previewed and executed as Jupyter
notebooks online with no need for local installation. To run Drake's tutorials
online, refer to the `Drake Tutorials <https://drake.mit.edu/>`_ website.
Alternatively, to run Drake's tutorials locally from an
`installed <https://drake.mit.edu/installation.html>`_ copy of Drake,
run ``python3 -m pydrake.tutorials`` to launch a Jupyter browser.
Be sure your ``PYTHONPATH`` has been set per the installation instructions,
e.g., via ``source env/bin/activate`` in the
`pip instructions <https://drake.mit.edu/pip.html>`_.
If you haven't done so already, you'll also need to install the Jupyter
notebook package on your system:
- For pip or macOS, use: ``pip install notebook``.
- For Ubuntu, use ``sudo apt-get install jupyter-notebook``.
"""
def __main():
import sys
import pydrake
sys.argv = ["notebook", f"{pydrake.getDrakePath()}/tutorials/index.ipynb"]
try:
from notebook import notebookapp as app
except ImportError:
print("ERROR: the Jupyter notebook runtime is not installed!")
print()
print(__doc__)
sys.exit(1)
app.launch_new_instance()
if __name__ == "__main__":
__main()