.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "examples/changing_download_location.py" .. LINE NUMBERS ARE GIVEN BELOW. .. only:: html .. note:: :class: sphx-glr-download-link-note :ref:`Go to the end ` to download the full example code. .. rst-class:: sphx-glr-example-title .. _sphx_glr_examples_changing_download_location.py: Changing the Download Location ============================== This example demonstrates how to change the default download location for datasets in the `em_database` package. By default, datasets are downloaded to a predefined directory, but users can customize this location as needed. .. GENERATED FROM PYTHON SOURCE LINES 9-27 .. rst-class:: sphx-glr-script-out .. code-block:: none Current download directory: /home/runner/em_database Updated download directory: /path/to/your/custom/directory Reset download directory: /home/runner/em_database | .. code-block:: Python from em_database import get_data_dir, set_data_dir, reset_data_dir # Display the current download directory print("Current download directory:", get_data_dir()) # Set a new download directory new_directory = "/path/to/your/custom/directory" # Replace with your desired path set_data_dir(new_directory) print("Updated download directory:", get_data_dir()) # Reset to the default download directory reset_data_dir() print("Reset download directory:", get_data_dir()) .. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 0.001 seconds) .. _sphx_glr_download_examples_changing_download_location.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: changing_download_location.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: changing_download_location.py ` .. container:: sphx-glr-download sphx-glr-download-zip :download:`Download zipped: changing_download_location.zip ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_