Files
pyscript/examples/toga/README.md
Hood Chatham 08f34f748b Apply prettier to css, html, js, md, ts, and yml (#1249)
* Apply prettier to css, js, html, md, ts, and yml

As a followup I will add prettier to the .pre-commit config.
This patch is 100% generated by prettier.
I used a forked version of prettier that understands the
py-script tag.
See https://github.com/hoodmane/pyscript-prettier-precommit
for more info.

* Apply old pre-commit

* Revert some problems

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Revert some changes

* More changes

* Fix pre-commit

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2023-03-06 14:20:21 +00:00

1.3 KiB

Freedom Units!

This is a demo Toga app implementing a Fahrenheit to Celsius converter.

It can be served as a Single Page App from a static web server.

Initial setup

  1. Create and activate a virtual environment, and move into the freedom project directory:

    $ python -m venv venv $ . ./venv/bin/activate $ cd freedom

  2. Install Briefcase:

    $ pip install briefcase

Web app

This app can be viewed as a Single Page App (SPA); this version of the app is linked from the main PyScript demo pages. To re-build the app and start a local webserver, run:

$ briefcase run web

Desktop app

To run this app as a desktop app in development mode:

$ briefcase dev

To build and run it as an app bundle:

$ briefcase run

Mobile app

To run this in the iOS simulator, run:

$ briefcase run iOS

To run this in the Android simulator, run:

$ briefcase run android

Note that these builds have extensive requirements that must be installed - Xcode for iOS, and the Android SDKs for Android. These are multiple gigabyte downloads. Briefcase will detect when these tools aren't available, and either prompt you to download them, or perform a download for you. As a result, your first build may take up to 20 minutes to complete, depending on the speed of your connection.