Download app.py from OrganizedProgrammers/Test_File_Editing: direct link, hf CLI and curl.
- Browser
- Download file 435 Bytes
-
https://huggingface.co/spaces/OrganizedProgrammers/Test_File_Editing/resolve/c048b860ca113b9d30b0e8cf8c9060a66e3fcdcc/app.py
- Command line
-
hf download hf://spaces/OrganizedProgrammers/Test_File_Editing@c048b860ca113b9d30b0e8cf8c9060a66e3fcdcc/app.py
-
curl -L -o app.py https://huggingface.co/spaces/OrganizedProgrammers/Test_File_Editing/resolve/c048b860ca113b9d30b0e8cf8c9060a66e3fcdcc/app.py
435 Bytes
| import gradio as gr | |
| def append_text_to_file(text): | |
| file_path = 'text_file.txt' | |
| with open(file_path, 'a') as file: | |
| file.write(text + '\n') | |
| with open(file_path, 'r') as file: | |
| new_content = file.read() | |
| print(new_content) | |
| with gr.Blocks() as demo: | |
| tb_input = gr.Textbox(label='enter some text') | |
| tb_input.submit(append_text_to_file, inputs=tb_input, outputs=None) | |
| demo.launch(debug=True) |