Git Product home page Git Product logo

pytov's Introduction

pytov Documentation Status

Python but tov (good).

Examples
Visual Studio Code Extension

Features

  • Curly braces (not must)
  • No identation errors (if you use the curly braces)
  • Long and short comments (/**/, //)
  • Short boolean operators (and - &&, or - ||, not - !)
  • Lower case true and false supported too
  • Switch statement
  • Compiles to python

Requirements

  • python 3

How to use

First, run $ pip install pytov, and then, to run files, simply run in the command line $ pytov path_to_file. If you want to also save the compiled python file use ($ pytov path_to_file -py).

Syntax

if (1 && 1){
                   print("i dont care about indentation");
   if(1==1){
print("except");
}
       }
if (1!=2){
    print("\'ihihih\'");
    print({"hi":1}["hi"]);
}

def hi(){
    print("hi");
}

def hello(){
    print("hello\"");
}

print(true || false) // you don't have to use capital T and F in true and false.

def indentation():
    print("You don't have to use the braces, the regular indentation works too")


anotherTest()

dict = {"hello":1};

/*
this will not be an error
multi line
*/

//this one too

print(1 /_ 3) // floor division

switch("hii", {
    "hello":
        lambda{ print("hello"); },
    "hi":
        lambda{ print("hi"); },
    },
        lambda{ print("default case"); },
);

The sample above shows use of pytov syntax.

Just like C, use curly braces instead of colons (but they still work too), and there are no more identation errors.

def test(){
        print("no identation errors")
    pass
}
if (1 == 1){
    pass
}

Switch

switch(var, cases, *args)

  • var - the value to switch on.
  • case - a dictionery of case that the var might be and their callbacks.
  • *args(optional) - default case.

switch is a selection statement that chooses a single switch section to execute from a list of cases.

Comments

Multiline:

/*
use this syntax if you want the text to be commented out
and yes, it works on multiple lines.
*/

Single line

// you can also write single line comments like this

Short boolean operators

Instead of:

if True and False:
    pass
elif True or False:
    pass
elif not True:
    pass

you can now use:

if True && False{
    pass
}
elif True || False{
    pass
}
elif !True{
    pass
}

Full documentation


pytov's People

Contributors

staticfloat avatar yuvix25 avatar

Watchers

 avatar

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.