From 479348eec9739eed3b7c4bdf98cf1dedbc303be7 Mon Sep 17 00:00:00 2001 From: Leonardo Pliger <107443042+lpliger@users.noreply.github.com> Date: Fri, 24 Jun 2022 14:14:48 -0500 Subject: [PATCH] Added section and cleared up documentation in getting started (#547) * add section and cleared up documentation * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * I fixed the typo in getting-started Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> --- docs/tutorials/getting-started.md | 38 +++++++++++++++++++++++++++++-- 1 file changed, 36 insertions(+), 2 deletions(-) diff --git a/docs/tutorials/getting-started.md b/docs/tutorials/getting-started.md index 755d5982..ea6f116a 100644 --- a/docs/tutorials/getting-started.md +++ b/docs/tutorials/getting-started.md @@ -5,16 +5,50 @@ This page will guide you through getting started with PyScript. ## Development setup PyScript does not require any development environment other -than a web browser. We recommend using [Chrome](https://www.google.com/chrome/). +than a web browser (we recommend using [Chrome](https://www.google.com/chrome/)) and a text editor, even though using your [IDE](https://en.wikipedia.org/wiki/Integrated_development_environment) of choice might be convenient. If you're using [VSCode](https://code.visualstudio.com/), the [Live Server extension](https://marketplace.visualstudio.com/items?itemName=ritwickdey.LiveServer) can be used to reload the page as you edit the HTML file. +## Trying before installing + +If you're new to programming and know nothing about HTML or just want to try some of PyScript features, we recommend using the [REPL](https://en.wikipedia.org/wiki/Read%E2%80%93eval%E2%80%93print_loop) element in the [PyScript REPL example](https://pyscript.net/examples/repl.html) instead so you can have a programming experience in a REPL that doesn't require any setup. This REPL can be used to have an interactive experience using Python directly. + + Alternatively, you can also use an online editor like W3School's [TryIt Editor](https://www.w3schools.com/html/tryit.asp?filename=tryhtml_default_default) and just plug the code below into it, as shown in the [example](https://docs.pyscript.net/latest/concepts/what-is-pyscript.html#example) page and click the run button. + +```html + + + + + + + REPL + + + + + + + + Hello world!
+ This is the current date and time, as computed by Python: + +from datetime import datetime +now = datetime.now() +now.strftime("%m/%d/%Y, %H:%M:%S") + + + +``` + +You could try changing the code above to explore and play with pyscript yourself. + ## Installation There is no installation required. In this document, we'll use -the PyScript assets served on https://pyscript.net. +the PyScript assets served on [https://pyscript.net](https://pyscript.net). If you want to download the source and build it yourself, follow the instructions in the [README.md](https://github.com/pyscript/pyscript/blob/main/README.md) file.