.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "auto_examples/plot_example.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 or to run this example in your browser via JupyterLite. .. rst-class:: sphx-glr-example-title .. _sphx_glr_auto_examples_plot_example.py: R data loading ============== Use the file uploader to convert files to Python. .. GENERATED FROM PYTHON SOURCE LINES 8-25 .. rst-class:: sphx-glr-script-out .. code-block:: none interactive(children=(FileUpload(value=(), accept='*.rd*', description='Upload', multiple=True), Output()), _dom_classes=('widget-interact',)) | .. code-block:: Python # sphinx_gallery_thumbnail_path = '_static/R_logo.svg' from ipywidgets import FileUpload, interact import rdata @interact(files=FileUpload(accept="*.rd*", multiple=True)) def convert_from_file(files): """Open a rds or rdata file and display its contents as Python objects.""" for f in files: parsed = rdata.parser.parse_data(f.content) converted = rdata.conversion.convert(parsed) for key, value in converted.items(): print(f"{key}:") print(value) .. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 0.054 seconds) .. _sphx_glr_download_auto_examples_plot_example.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: lite-badge .. image:: images/jupyterlite_badge_logo.svg :target: ../lite/lab/index.html?path=auto_examples/plot_example.ipynb :alt: Launch JupyterLite :width: 150 px .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: plot_example.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: plot_example.py ` .. container:: sphx-glr-download sphx-glr-download-zip :download:`Download zipped: plot_example.zip ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_