Docs

The Code Editor

Welcome to the py.space code editor! The editor has everything you need to write, test, and share your Python code seamlessly. Let’s take a quick tour:

  1. Settings: Customize your widget settings here. You can change the widget’s name, description and thumbnail in the widget’s settings. You can also return home to your py.space dashboard or delete the widget entirely. You will also find the options to undo or redo your recent changes.

  2. Name: Give your project a name for easy identification. Click on the pencil next to the widgets name to edit it anytime.

  3. Privacy Buttons: Switch between public and private mode to control who can see your project. Public projects are visible to everyone, while private projects are accessible only to you.

  4. Share Button: You can fork a project to create your own copy. It’s perfect for experimenting with others’ code or creating variations of existing projects. Check out the docs for more information on sharing and embedding your widgets.

  5. Help Button: Need assistance? Click here to access the documentation.

  6. Open In Anvil Button: Click to open your project in Anvil and start building full-stack applications. For more information on Anvil and what this means, see below.

  7. Code And GUI Tabs: Use the tabs to switch between server code, client code and the GUI editor (these tabs will only appear in GUI widgets).

  8. Packages Tab: Install and manage Python packages for your projects. Search for packages, install them, and keep track of dependencies in one place.

  9. Secrets Tab: Store and manage sensitive information securely. Use this tab to add, edit, or delete secrets that your code may require.

  10. The Console: The console displays the output of your code execution and any unhandled exceptions (if any).

  11. Schedule Button: Schedule your code to run at specific times and intervals.

  12. URL: When creating HTTP endpoints or GUIs you get a URL for your widget or endpoint. This is shown in the bottom right of the editor.

  13. Run Button: Whether it’s a script, scheduled task, or GUI, hit the run button to see your code in action.

The Code Editor With Annotations

The Annotated Code Editor

The Code Editor With Annotations

The Annotated Code Editor

With these features, PySpace offers a powerful and user-friendly environment for all your Python projects. Happy coding!

Open In Anvil

py.space is the place to build small useful things with Python. Anvil is the free-to-use fully-featured tool to take your ideas to the next level and build commercial-grade apps.

Anvil is a platform for building full-stack web apps with nothing but Python. It includes a built-in database, full control over design and style, user authentication, multiple GUIs per app, version control, deployment environments and much more.

The Anvil button Anvil Button opens your widget in the Anvil Editor. There, your widget’s code will be ready to use, edit and expand on.

The Code Editor With Location of the Open In Anvil button highlighted.

Location of the Open In Anvil button

Console

The Console will appear after you run your widget. It shows the output of print statements from within your widget’s code.

The Editor With The Console Showing The Print Output.

The Editor With The Console Showing An Example Print Output

It also shows tracebacks from unhandled exceptions, and (occasionally) messages from the py.space system about your app.

An Example Of The Editor With The Console Showing An Exception.

An Example Of The Editor With The Console Showing An Exception

Output from Server Modules will appear with an orange border on the left-hand margin, while output from Client code and UIs will appear with a blue border.

Viewing A Widget As A Third Party

When sharing your widget with others, whether it’s embedded in another website or you link directly to it, people will see a stripped down version of the editor. The editor will allow them to see your code, run it, and share or fork the widget for themselves.

To fork or share a widget, please see the full docs here.


Do you still have questions?

Our Community Forum is full of helpful information and friendly experts.