Skip to content

Instantly share code, notes, and snippets.

import os
def create_gitignore():
"""Creates a basic .gitignore file if it does not exist."""
if not os.path.exists(".gitignore"):
with open(".gitignore", "w") as f:
f.write("""# Python-specific ignores
__pycache__/
*.pyc