Skip to content

Saving and sharing your work

Saved in your browser as you type

pygwide saves your projects in your web browser as you work, within two seconds of each change, and again just before your program runs. Next time you open pygwide in the same browser, they are still in My Projects.

If a change cannot be saved, perhaps because the browser's storage is full, a message at the top of the page says so. Your work is still there while the tab stays open, and pygwide tries again when you next change something or press Run.

Why you should export as well

The copy in your browser is not safe on its own. Many club and school computers clear their browsers' storage when you log off, or between sessions, and a different computer has none of your work.

So at the end of each session, export your project. That gives you a zip file you can keep on a USB stick, in your own storage, or anywhere else, and import again next time.

Export a project

Open the project and press ⇩ Export at the top of the page. Your browser saves a zip file named after the project, such as Space Game.zip.

  • Any character that a file name cannot hold, such as / or ?, becomes _ in the zip's name. Your project's own name does not change.
  • The zip holds every file in your project, plus a small file called pygwide.json that holds the project's details, such as its name and type.

Exporting an example gives you the example as it was published. Once you have changed it, you are working on your own copy, and that is what is exported.

Import a project

On the home page, press ⇪ Import a project, above My Projects.

First, pygwide warns you:

A project's program can do anything pygwide itself can do in this browser. Only import projects from people you trust.

Press Choose a zip file to carry on, or Cancel. Then pick the zip. The project appears in My Projects.

If you already have the project

Every project has its own ID, which it keeps when it is exported and imported. If My Projects already has the same project, perhaps because you exported it last week, pygwide asks what to do:

  • Keep both adds the imported project as a copy, with a new name such as "Space Game (2)". Nothing is lost, so this is the choice already picked for you.
  • Replace mine puts the imported project in place of yours.

If a different project already has the same name, the imported project gets the next free name, such as "Space Game (2)".

A zip of a folder

You can also import a zip that holds a single folder with the project inside it. This is what you get if you unzip an exported project, then zip the folder again, for example with Send to → Compressed (zipped) folder in Windows, or Compress on a Mac. Only one folder is unwrapped, and only if nothing else sits beside it in the zip. A Mac adds a __MACOSX folder and .DS_Store files of its own to the zips it makes, and Windows can add Thumbs.db files. pygwide leaves them all out.

Very large files

If a zip holds a file larger than 10 MB, pygwide names each one and its size, and asks before importing. Files that large may make pygwide slow, or stop it working on some computers. Press Import anyway to go on, or Cancel to import nothing.

When a zip is refused

pygwide checks the whole zip before adding anything. If anything is wrong, nothing is imported, and a message says why. A zip is refused if:

  • it is not a zip file, or it is damaged;
  • it is not a pygwide project, because it has no pygwide.json file, or no main.py;
  • its pygwide.json file cannot be read, or is missing some details;
  • a file in it has a name that could not be used safely, such as one that leads outside the project, uses a character that file names cannot hold, is one Windows keeps for itself such as con.txt, or has the same name as another apart from capital letters;
  • a file in it is not a type a project can hold. A project can hold Python (.py), pictures (.png, .jpg, .jpeg, .gif, .bmp), sounds (.wav, .ogg, .mp3), fonts (.ttf, .otf), and text and data (.txt, .md, .json, .csv);
  • it was saved by a newer version of pygwide. Reload the page to get the newest version, then import it again.

Examples

The examples on the home page are there to try and to learn from. Opening one shows it, and you can run it as it is. The example itself never changes: the moment you change it, pygwide copies it into My Projects as a project of your own, and you carry on with your copy. Running an example whose program saves a file, such as Calendar or High scores, counts as a change too, and your copy keeps the file. A note at the top of the page tells you which you are looking at.

Changing a project's details

On the home page, press ✎ Details on a project's tile to give it a new name, change its description or give it a picture of your own. A picture is made small enough to fit the tile. Press Use the default picture to go back to the one pygwide gives it. Each project needs a name that none of your other projects has.

To delete a project, press Delete project… in the same window. pygwide asks you first, naming the project. Deleting cannot be undone, so export anything you want to keep before you do it.

Starting again with an empty workspace

To delete every project saved in this browser, open ⚙ Settings and choose Clear local workspace. pygwide warns you first, and deletes nothing unless you press Delete all projects. This cannot be undone, so export anything you want to keep before you do it. Zips you have exported are not touched, and the examples stay.