Giter Site home page Giter Site logo

pybraces's Introduction

========
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__


pybraces's People

Contributors

thatch avatar

Stargazers

Valerio Capello avatar Aditya Sista avatar Emmanuel Segun-Lean avatar Ruijie Fang avatar  avatar  avatar jorjun avatar Ravish  avatar  avatar hadi tarhini avatar Huseyin Karabas avatar Lilian Besson avatar Chris Ramstad avatar James Milne avatar Cat Stevens avatar Anon Y. avatar Synced Synapse avatar Gonzo Fialho avatar Lucas Teske avatar Ben Moyer avatar

Watchers

 avatar jorjun avatar James Cloos avatar Kaizhao Zhang avatar

pybraces's Issues

demo0 not working

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.