Share Python code with CodeThis

Python is the default language for data, scripting, and teaching. Paste a notebook-free snippet when you need to share results without the Jupyter overhead.

Paste Python now

What you get

  • Python-aware syntax highlighting via CodeMirror
  • Instant shareable link — no signup required
  • Optional expiration (7 days, 30 days, permanent)
  • Password protection for private pastes
  • Works with the REST API and MCP server
  • Rich markdown and MDC components alongside code

Common use cases for Python pastes

  • Data analysis one-offs
  • CLI and automation scripts
  • Teaching examples and homework
  • Bug reports and tracebacks

Example

from itertools import groupby

def run_length(seq):
    return [(k, sum(1 for _ in g)) for k, g in groupby(seq)]

print(run_length("aaabbc"))  # [('a', 3), ('b', 2), ('c', 1)]

Related languages

Ready to share some Python?