How to add new encodings in python?

0

I'm trying to install pybraces but I can not. How do I install it?

I'm using python 2.7 and windows 10

    
asked by anonymous 17.10.2015 / 14:55

1 answer

3

You should not install "pybraces" - if you want to learn Python, I recommend learning Python and not installing a modification to the language that will make it non-default. If you actually use Pybraces you will use something that is not equal to Python for anyone who knows Python, and is not the same as Java-derived "C" languages using "{" and "}" to delimit blocks.

Incidentally, since it is not an extensively tested project, it will hardly even have syntactic support for statements that use keys normally in Python such as dictionaries, sets, dict comprehensions, and set comprehensions.

In addition, no example of Python that you find on the internet (or stack overflow) will work.

If "{" and "}" are so important to you, you might want to study Javascript instead of Python.

That said, the installation instructions are in the README, in the link that you placed:

You'll need to copy or symlink braces.py into your Python lib/encodings
directory, and ensure that your user has rights to create the .pyc or .pyo
file there.

That is, simply put the braces.py file in the lib/encodings folder of your Python installation - and declare the encoding of each file with # coding: braces on the first line.

The Pybraces project itself warns that it is "silly": a way to put "{" and "}"     

17.10.2015 / 20:56