GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - lemonyte/no-code: The best way to write code is to write no code at all.

BranchesTags
Open more actions menu

Latest commit

 

History

50 Commits
50 Commits

Folders and files

NameName
Last commit message
Last commit date
.github
.github
 
 
purelib
purelib
 
 
src/no_code
src/no_code
 
 
tests
tests
 
 
.gitignore
.gitignore
 
 
.pre-commit-config.yaml
.pre-commit-config.yaml
 
 
LICENSE.txt
LICENSE.txt
 
 
README.md
README.md
 
 
pyproject.toml
pyproject.toml
 
 
uv.lock
uv.lock
 
 

Repository files navigation

No Code

The best way to write code is to write no code at all.

Writing code that does nothing is great, but sometimes you still want your code to do something. This package allows you to write nothing, and still have your code do something.

Installation

Tip

It is highly recommended to use a virtual environment for proper installation of the no.pth file.

python -m pip install no-code

Python 3.10 or a newer version is required.

Usage

This package is intended to be used as a command-line tool.

Important

Make sure you are in an activated virtual environment. Using uv run tends to break this package.

To turn your code into no code:

$ cat some_code.py
print("Hello, world! 😁")

$ no_code some_code.py > no_code.py

$ cat no_code.py
# coding: no
ā€‹ā€Œā€Œā€Œā€‹ā€‹ā€‹ā€‹ā€‹ā€Œā€Œā€Œā€‹ā€‹ā€Œā€‹ā€‹ā€Œā€Œā€‹ā€Œā€‹ā€‹ā€Œā€‹ā€Œā€Œā€‹ā€Œā€Œā€Œā€‹ā€‹ā€Œā€Œā€Œā€‹ā€Œā€‹ā€‹ā€‹ā€‹ā€Œā€‹ā€Œā€‹ā€‹ā€‹ā€‹ā€‹ā€Œā€‹ā€‹ā€‹ā€Œā€‹ā€‹ā€Œā€‹ā€‹ā€Œā€‹ā€‹ā€‹ā€‹ā€Œā€Œā€‹ā€‹ā€Œā€‹ā€Œā€‹ā€Œā€Œā€‹ā€Œā€Œā€‹ā€‹ā€‹ā€Œā€Œā€‹ā€Œā€Œā€‹ā€‹ā€‹ā€Œā€Œā€‹ā€Œā€Œā€Œā€Œā€‹ā€‹ā€Œā€‹ā€Œā€Œā€‹ā€‹ā€‹ā€‹ā€Œā€‹ā€‹ā€‹ā€‹ā€‹ā€‹ā€Œā€Œā€Œā€‹ā€Œā€Œā€Œā€‹ā€Œā€Œā€‹ā€Œā€Œā€Œā€Œā€‹ā€Œā€Œā€Œā€‹ā€‹ā€Œā€‹ā€‹ā€Œā€Œā€‹ā€Œā€Œā€‹ā€‹ā€‹ā€Œā€Œā€‹ā€‹ā€Œā€‹ā€‹ā€‹ā€‹ā€Œā€‹ā€‹ā€‹ā€‹ā€Œā€‹ā€‹ā€Œā€‹ā€‹ā€‹ā€‹ā€‹ā€Œā€Œā€Œā€Œā€‹ā€‹ā€‹ā€‹ā€Œā€‹ā€‹ā€Œā€Œā€Œā€Œā€Œā€Œā€‹ā€‹ā€Œā€Œā€‹ā€‹ā€‹ā€Œā€‹ā€‹ā€‹ā€‹ā€‹ā€‹ā€Œā€‹ā€‹ā€Œā€‹ā€‹ā€‹ā€Œā€‹ā€‹ā€‹ā€Œā€‹ā€Œā€‹ā€‹ā€Œā€‹ā€‹ā€‹ā€‹ā€Œā€‹ā€Œā€‹

You can then run no code as usual:

$ python no_code.py
Hello, world! 😁

If, for some reason, you need to turn no code back into Python code:

$ yes_code no_code.py > some_code.py

$ cat some_code.py
print("Hello, world! 😁")

Troubleshooting

If you get SyntaxError: invalid syntax, make sure the line # coding: no is present at the top of your script.

If you get SyntaxError: encoding problem: no, follow the steps below to make sure the no encoding is registered on startup:

  1. Run SITE_PACKAGES=$(python -c 'import sysconfig; print(sysconfig.get_path("purelib"))') to get the path to the Python site-packages directory.
  2. Run echo "import no_code" > "$SITE_PACKAGES/no.pth" to register the no encoding on startup.

Note

If using PowerShell, use $SITE_PACKAGES instead of SITE_PACKAGES to assign the variable.

This issue is commonly encountered when installing no-code into the user site-packages.

More details

Not satisfied with no code? The package also provides two functions to easily convert between something and nothing.

  • no_code.nothing(): Transform something (a string or bytes-like object) into nothing.
  • no_code.something(): Transform nothing into something (a string or bytes-like object).

The commands no_code and yes_code also accept input from stdin if no file is provided.

$ echo "print(bool(1))" | no_code | yes_code | python
True

Credits

Inspired by Kelsey Hightower, based on INVISIBLE.js by Martin Kleppe.

License

MIT License

About

The best way to write code is to write no code at all.

Topics

encodingesolangesotericjokeno-codepython

Resources

Readme
MIT license
Activity

Stars

56 stars

Watchers

2 watching

Forks

1 fork
Report repository

Releases

Packages

Used by

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800Ɨ600. No cookies required.