Shiny apps
PyCafe supports creating, running, editing, and sharing Shiny applications directly in your browser. There’s no need for any installation; it works with just a single click.
Your first app
Go to our homepage at https://py.cafe/ and click the Shiny tile:
Once the page is loaded, you should see an Editor
and File Browser
on the left, and Preview Browser
on the right with the the Shiny app in it:
You can see the Terminal
on the bottom right where you print statements go.
Editing the app
You can edit app.py
in the Editor
, and work as your normally would with Shiny.
Uploading an app.py
You may want to upload a local file from your computer if you already developed a shiny app locally.
From the file browser, you can choose New file
→ Upload files
to upload an existing app.py
or other Python scripts or modules.
You can even upload images, csv files or any file you need for your Shiny application.
Sharing your shiny app
Share app with code
If you are ready with your Shiny app, you might want to share it with other people.
You can share the screen you are seeing, with the Editor
and Preview Browser
open, by going to the Share
dialog.
Click the Share
button on the left, and you will see a dialog like this:
Click the “copy to clipboard” button
, and paste the link in an email or document to share it with others.Share as an app
If you want visitors to only see the app, and not the Editor
or File Browser
, select the
“APP” tab in the Share
dialog, and use that link instead.
People who visit this link, will see just the Shiny app, as shown below:
Note: Visitors can still read your sourcecode, read more about how PyCafe works.
Embed in an iframe
It is also possible to embed you app into an existing web page using an iframe. Choose the “EMBED” tab in the Share dialog and copy the HTML snippet into your clipboard:
You can now insert the HTML snippet into your website or blog post. The result should look like this:
Wrap up
Congratulations, you have successfully created your first Shiny app on PyCafe. You can now share it with your friends, colleagues, or embed it on your website.