thatch / pybraces Goto Github PK
View Code? Open in Web Editor NEWProof of concept for using silly encodings for source files
Proof of concept for using silly encodings for source files
======== pybraces ======== This is a quick hack as an encoding to support using braces instead of significant whitespace in Python. It transforms all '{' at EOL to a colon and more indentation on the next line. '}' dedents likewise. Semicolons are not something this script deals with -- they're supported in Python but the way I use them (delimiting end of line) is a little silly. Installation ============ 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. Example Files ============= demo0.py -------- This shows off the core functionality -- being able to convert braces to indentation (or at least ignore them, since this already has decent indentation). The important part is the 'encoding: braces' on line two. doc.py ------ This shows that multiline strings can also benefit:: >>> import doc >>> print doc.__doc__
I just tried:
sudo cp braces.py /usr/lib/python2.7/encodings/braces.py
$ python demo0.py
File "demo0.py", line 2
SyntaxError: encoding problem: braces
Ubuntu 17.04
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.