% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/shinylive-link.R
\name{shinylive_py_link}
\alias{shinylive_py_link}
\title{Create a Shinylive sharelink for Python Shiny apps}
\usage{
shinylive_py_link(
  input = NULL,
  mode = "editor",
  header = TRUE,
  base_url = NULL
)
}
\arguments{
\item{input}{App input. Can be:
\itemize{
\item Character string: Python code for the app
\item File path: Path to app.py file
\item Vector of file paths: Multiple files for the app
\item Named list: \code{list("app.py" = code1, "utils.py" = code2)}
\item NULL: Read from clipboard
}}

\item{mode}{Shinylive display mode (default \code{"editor"}). \code{"editor"} shows an
editable code panel beside the running app; \code{"app"} shows only the running app.}

\item{header}{Logical, whether to show the Shinylive header bar. It applies only
when \code{mode = "app"} and is ignored in the default \code{"editor"} mode. Defaults to \code{TRUE}.}

\item{base_url}{Custom Shinylive base URL. If NULL (default), links point at https://shinylive.io.}
}
\value{
shinylive_link object containing the Shinylive URL and metadata
}
\description{
Generates a shareable URL for Python Shiny applications that can run in the browser
using Shinylive. Supports character strings, file paths, named lists, and clipboard input.
}
\examples{
# String input
app_code <- "
from shiny import App, render, ui
app_ui = ui.page_fluid(ui.h2('Hello World'))
def server(input, output, session): pass
app = App(app_ui, server)
"
shinylive_py_link(app_code)

# Multiple files as a named list
shinylive_py_link(list(
  "app.py" = app_code,
  "utils.py" = "def helper(): return 42"
))

# File path input
app_dir <- tempfile()
dir.create(app_dir)
app_path <- file.path(app_dir, "app.py")
writeLines("from shiny import App, ui", app_path)
shinylive_py_link(app_path)

# Read the app from the clipboard
if (interactive()) {
  shinylive_py_link()
}
}
\seealso{
\code{\link[=shinylive_project]{shinylive_project()}} for multi-file apps; \code{\link[=decode_shinylive_link]{decode_shinylive_link()}}
and \code{\link[=preview_shinylive_link]{preview_shinylive_link()}} to read a link back.
}
