Skip to content

How to print the name of a file uploaded via a button? #3256

Answered by akshayka
hopezh asked this question in Q&A
Discussion options

You must be logged in to vote

@hopezh , you have to assign UI elements to global variables and output the global variable. Your displayed button doesn't have an associated variable so it doesn't work.

You also need to end the cell with f in order to display the button.

Try this instead: https://github.com/marimo-team/marimo/blob/main/examples/ui/file.py

Tip: You can run this notebook with

marimo edit https://github.com/marimo-team/marimo/blob/main/examples/ui/file.py

at the command line.

For many more examples, see: https://github.com/marimo-team/marimo/tree/main/examples

For a tutorial on using UI widgets please run: marimo tutorial ui at the command-line.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by akshayka
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants