Python but tov (good).
Examples Visual Studio Code Extension pypi
/**/
, //
)and
- &&
, or
- ||
, not
- !
)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
).
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 indentation errors.
def test(){
print("no identation errors")
pass
}
if (1 == 1){
pass
}
switch(var, cases, *args)
switch is a selection statement that chooses a single switch section to execute from a list of cases.
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
Instead of:
if True and False:
pass
elif True or False:
pass
elif not True:
pass
you can now use (pass no required):
if true && false{
}
elif true || false{
}
elif !true{
}