Share Python Code – a runnable Pastebin

Your code snippet will expire in one week
Sign up to create non-expiring code snippets

About, Privacy, Terms

This is a free tool for sharing Python code quickly, designed for Python learners and teachers.

If you'd like to share something that isn't Python code, try one of these other code sharing tools:


Code snippet links are not indexed by search engines, but don't expect privacy from them (guessing URLs is possible).


Code snippets expire after 7 days by default. You can signup for a Python Morsels account to make unexpiring code snippets.

Code snippets may be removed before their expiration date. We are not responsible for data loss or removed pastes.

Acceptable Use Policy

This page was created for sharing Python code snippets. Submitting many pastes per day is fine, but uploading an excessive amount of data or using excessive bandwidth is frowned upon.

And remember that this is not a file hosting service.

Please do not post information that should be private or secure. Please do not use this service to cause harm.


Python Pastebin Tips

Include a module-level docstring to give your code snippet a title.

For runnable code, remember to print the output you'd like shown.

An HTTP GET from a command-line tool returns just your code
curl -L

Link previews in Slack and on social media will show your code.