<jupyter_start><jupyter_text>ipyfilechooser examples<jupyter_code>from ipyfilechooser import FileChooser
import os

# Create new FileChooser:
# Path: current directory
# File: test.txt
# Title: <b>FileChooser example</b>
# Show hidden files: no
# Use the default path and filename as selection: yes
fdialog = FileChooser(
    os.getcwd(),
    filename='test.txt',
    title='<b>FileChooser example</b>',
    show_hidden=False,
    select_default=True
)

display(fdialog)
# Get the selected value
fdialog.selected
# Callback example
def change_title():
    fdialog.title = '<b>Callback function executed</b>'

# Register callback function
fdialog.register_callback(change_title)
# Set or change the title
fdialog.title = '<b>Select the output file</b>'
# Show hidden files and change rows to 10
fdialog.show_hidden = True
fdialog.rows = 10
# Change the default path and filename
fdialog.default_path = os.path.abspath(os.path.join(os.getcwd(), '..'))
fdialog.default_filename = 'foobar.txt'
# Reset to defaults and clear the selected value
fdialog.reset()
# String representation
print(fdialog)
# Print the version number
import ipyfilechooser
ipyfilechooser.__version__<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.10091743119266056, 'fraction_numerical': 0.003336113427856547, 'mean_word_length': 5.521739130434782, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '11465', 'license': 'MIT', 'n_tokens_mistral': 388, 'n_tokens_neox': 378, 'n_words': 108, 'path': 'ipyfilechooser_examples.ipynb', 'repo_name': 'danjjl/ipyfilechooser', 'size': '1199'}