Python in CoSpaces: I created a Python example project (Tiny Escape Room Project)

Hi everyone!

This is an example for how to use Python in CoSpaces (a tiny Escape Room Project):

I desperately searched the discussion forum and Google for good examples how to use Python in CoSpaces. It wasn’t much help, so I decided to create my own project. Tbh: I HATE Python in CoSpaces. But it works. I tried it with my students and once you are familiar with the little tweeks of the CoSpaces python, it somehow works (for example that the CoSpaces time library works different than the regular Python time library or that you have to call the global variables in the functions before you can use them which is super weird)… The code is messy and I had to try a lot of different stuff (even though I know Python) until I got it to work. Hope it helps you!

The project can be made much bigger, but I wanted to keep it simple and just show some core functions. If you find a way to improve the code and to include other functions, please let me know!

Cheers, Andy

3 Likes

This was super helpful. Knowing to redeclare global variables in every functions they needs them fixed my code.