1. Pyroom
  2. Tutorials
  3. Files and resources

Files and resources

Bring your own Python files into the Playground, download your work as a .py file, and add images or data files that your program can read.

When to use it

Use these tutorials when you move code between Pyroom and another editor, keep a copy of your work, or write programs that read CSV data, text or images.

Python source files

Open Menu β†’ File β†’ Import file to load a .py or .txt file into the editor. Importing replaces the current code, so export first if you want to keep it. Export file downloads your program as a .py file you can open in any editor.

Data, images and resources

Open Menu β†’ File β†’ Resources β†’ Add resources to add one or more files. Your code reads them from the resources/ folder:

with open("resources/scores.csv", encoding="utf-8") as file:
    print(file.read())

Use Manage resources to see what is loaded and remove files you no longer need. Images can be used by turtle, tkinter and matplotlib programs.

Learning path

The Beginner tutorial imports a Python file and exports it again. The Intermediate tutorial adds a CSV file and an image as resources and reads them from code.

Good to know

Resources are inputs for the current session. They are not included in share links, so add them again after opening a share or starting a new session. To upload and run a complete Tkinter project with many files, use LaunchPad or Pro Mode.

Feature overview β†’

Beginner

Import and export a Python file

Beginner

Beginner Video coming soon. The steps below show everything the video will cover.

Import a .py file into the Pyroom editor, run it, and export your work as a Python file you can open anywhere. Beginner tutorial.

Open tutorial β†’

Intermediate

All tutorials β†’

Try it in the Playground

Nothing to install and no account needed.

Open Playground β†’