underscores


Nameunderscores JSON
Version 0.0.2 PyPI version JSON
download
home_pageNone
Summary_ allows you to write Python code using only _.
upload_time2024-09-03 04:30:06
maintainerNone
docs_urlNone
authorLemonyte
requires_python>=3.9
licenseMIT License Copyright (c) 2023 Lemonyte Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
keywords _ underscore encoding joke
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # `_`

`_` allows you to write Python code using only `_`.

## Installation

> [!TIP]
> It is highly recommended to use a virtual environment for proper installation of the `_.pth` file.

```shell
python -m pip install underscores
```

[Python 3.9](https://www.python.org/downloads/) or a newer version is required.

## Usage

The following script is a "Hello, world!" program which can be executed by the Python interpreter:

```python
# coding: _
_ ____ _ _____ _ ____ __ _ _ ___ ______ ____ _ ____ _ ___ _ ____ __ ___ _ __ _
_____ _ _ ______ _____ _ ___ _ _ _ ___ _____ ______ _ ____ _ _ _ ____ _ _ _ ____
_ ____ _ __ __ ___ _ _ ______ ___ _ ____ __ ______ _ ____ _ ____ _ ____ __ _ _
____ _ _ _ ___ _____ _____ _ _ ______ ____ _ _ ______ _____ _ __ _ ______
```

You can generate a script with `_`:

```python
print('print("Hello, world!")'.encode("_").decode("utf-8"))
```

## Troubleshooting

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

If you get `SyntaxError: encoding problem: _`, follow the steps below to make sure the `_` 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 underscores" > "$SITE_PACKAGES/_.pth"` to register the `_` 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 `_` into the user site-packages.

## Credits

`_` is a port of [`_`](https://github.com/mame/_) from Ruby to Python.
Please check out the original creator [mame](https://github.com/mame).

Big thanks to [shailist](https://github.com/shailist) for [this](https://shailist.github.io/posts/python-source-preprocessor-custom-encoding/) awesome post about custom encodings.

## License

[MIT License](LICENSE.txt)

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "underscores",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.9",
    "maintainer_email": null,
    "keywords": "_, underscore, encoding, joke",
    "author": "Lemonyte",
    "author_email": null,
    "download_url": "https://files.pythonhosted.org/packages/dc/cc/e3087a237cdeb555bcca2b3d13d7b7c4ca68c673e80905c09a944b842e94/underscores-0.0.2.tar.gz",
    "platform": null,
    "description": "# `_`\n\n`_` allows you to write Python code using only `_`.\n\n## Installation\n\n> [!TIP]\n> It is highly recommended to use a virtual environment for proper installation of the `_.pth` file.\n\n```shell\npython -m pip install underscores\n```\n\n[Python 3.9](https://www.python.org/downloads/) or a newer version is required.\n\n## Usage\n\nThe following script is a \"Hello, world!\" program which can be executed by the Python interpreter:\n\n```python\n# coding: _\n_ ____ _ _____ _ ____ __ _ _ ___ ______ ____ _ ____ _ ___ _ ____ __ ___ _ __ _\n_____ _ _ ______ _____ _ ___ _ _ _ ___ _____ ______ _ ____ _ _ _ ____ _ _ _ ____\n_ ____ _ __ __ ___ _ _ ______ ___ _ ____ __ ______ _ ____ _ ____ _ ____ __ _ _\n____ _ _ _ ___ _____ _____ _ _ ______ ____ _ _ ______ _____ _ __ _ ______\n```\n\nYou can generate a script with `_`:\n\n```python\nprint('print(\"Hello, world!\")'.encode(\"_\").decode(\"utf-8\"))\n```\n\n## Troubleshooting\n\nIf you get `SyntaxError: invalid syntax`, make sure the line `# coding: _` is present at the top of your script.\n\nIf you get `SyntaxError: encoding problem: _`, follow the steps below to make sure the `_` encoding is registered on startup:\n\n1. Run `SITE_PACKAGES=$(python -c 'import sysconfig; print(sysconfig.get_path(\"purelib\"))')` to get the path to the Python site-packages directory.\n2. Run `echo \"import underscores\" > \"$SITE_PACKAGES/_.pth\"` to register the `_` encoding on startup.\n\n> [!NOTE]\n> If using PowerShell, use `$SITE_PACKAGES` instead of `SITE_PACKAGES` to assign the variable.\n\nThis issue is commonly encountered when installing `_` into the user site-packages.\n\n## Credits\n\n`_` is a port of [`_`](https://github.com/mame/_) from Ruby to Python.\nPlease check out the original creator [mame](https://github.com/mame).\n\nBig thanks to [shailist](https://github.com/shailist) for [this](https://shailist.github.io/posts/python-source-preprocessor-custom-encoding/) awesome post about custom encodings.\n\n## License\n\n[MIT License](LICENSE.txt)\n",
    "bugtrack_url": null,
    "license": "MIT License  Copyright (c) 2023 Lemonyte  Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:  The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.  THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ",
    "summary": "_ allows you to write Python code using only _.",
    "version": "0.0.2",
    "project_urls": {
        "Repository": "https://github.com/lemonyte/_"
    },
    "split_keywords": [
        "_",
        " underscore",
        " encoding",
        " joke"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "dccce3087a237cdeb555bcca2b3d13d7b7c4ca68c673e80905c09a944b842e94",
                "md5": "76ec748da65710daa1ba03fb6b4189ac",
                "sha256": "534eff86f99bc8edb7a69d432db178ea42e4aea8b4d6aa17774ebdfd792c5dc3"
            },
            "downloads": -1,
            "filename": "underscores-0.0.2.tar.gz",
            "has_sig": false,
            "md5_digest": "76ec748da65710daa1ba03fb6b4189ac",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.9",
            "size": 5534,
            "upload_time": "2024-09-03T04:30:06",
            "upload_time_iso_8601": "2024-09-03T04:30:06.437078Z",
            "url": "https://files.pythonhosted.org/packages/dc/cc/e3087a237cdeb555bcca2b3d13d7b7c4ca68c673e80905c09a944b842e94/underscores-0.0.2.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-09-03 04:30:06",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "lemonyte",
    "github_project": "_",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "underscores"
}
        
Elapsed time: 0.31312s