Python

Python Code Screenshot Generator

Turn Python snippets into images worth sharing, without leaving your Mac.

Python is the language people most often screenshot for tutorials and threads, usually because the snippet is short enough to read on a phone.

Codeshot detects Python from the code you paste, so there is no language picker to get wrong. Here is the same snippet in three of the 30 themes it ships with, rendered with the app's own stylesheets.

from dataclasses import dataclass

@dataclass
class Snapshot:
    code: str
    theme: str = "xcode"
    scale: int = 2

    def export(self, path):
        image = render(self.code, self.theme)
        return image.save(path, scale=self.scale)
Atom One · dark
from dataclasses import dataclass

@dataclass
class Snapshot:
    code: str
    theme: str = "xcode"
    scale: int = 2

    def export(self, path):
        image = render(self.code, self.theme)
        return image.save(path, scale=self.scale)
GitHub · dark
from dataclasses import dataclass

@dataclass
class Snapshot:
    code: str
    theme: str = "xcode"
    scale: int = 2

    def export(self, path):
        image = render(self.code, self.theme)
        return image.save(path, scale=self.scale)
Solarized · dark

Choosing a theme for Python

Keep it under about fifteen lines. Python's significant whitespace means a wrapped line reads as a mistake to anyone skimming, so a narrower ratio usually beats a wide one.

Getting the size right

Let the image follow your content, or lock it to a ratio — 1:1, 4:3, 3:2, 16:9, 9:16, 2:3, or 3:4 — then export at 1×, 2×, or 3× so it stays sharp on a retina display. Copy it straight to the clipboard with C, or save with S.

See all 30 themes side by side, or read the full workflow.

Built for Python, and 59 other languages

Everything runs on your Mac. Your code never leaves it.

Download for macOS