Pytov
The idea was to take all well known syntaxes, and combine them into one programming language with many posabilities.
Installation
Install using pip install pytov, or via git: git clone https://github.com/Yuvix25/Pytov.git.
Usage
If was installed via pip:
$ pytov [path_to_your_pytov_file]
If was installed via git:
Run using Python:
$ cd [folder_of_installation]
$ cd pytov
$ python pytov.py [path_to_your_pytov_file]
Run using pre-built executables:
$ cd [folder_of_installation]
$ cd exe
$ pytov [path_to_your_pytov_file]
Syntax
Comments:
# this is a comment
// this is also a comment
/*
and this is a
multi
line
comment
*/
Variables:
x = 5 // let or var or type is not required
print(x)
If:
if 5 > 1{
print("5 is greater than 1")
}
elif 1 > 5{ # else if 1 > 5 will work too!
print("1 is greater than 5")
}
else {
print("1 is equal to 5")
}
Loops:
For:
for i in range(10){
print(i)
}
a = [1, 4, 7, 8]
for x in a{
print(x)
if x == 4{
break // loop will stop when x == 4
}
}
for (i = 5; i<10; i++){
print(i)
}
// output: 5, 6, 7, 8, 9
While:
// loop the the block as long as x < 5
x = 0
while x < 5{
print(x)
x += 2
// (break will work just the same here)
}
Switch:
// for more info about switch take a look at switch in js, it is exactly the same...
a = "hi"
switch a{
case "hello":
print("a=='hello'")
break
case "hi":
case "hihi"
print("a=='hi' or a=='hihi'")
break
default:
print("a!='hi' and a!='hihi' and a!='hello'")
}
Functions:
(func or function or def) func_name(required_params, not_required_params){
your_code_here
// and if you want you can return like this: return value
}
function print_hi(times){ // required parameter
for i in range(times){
print("hi")
}
}
def print_hi_default(times=3){ // not required parameter with default value of 3
for i in range(times){
print("hi")
}
}
func mult(x, y){
return x*y
}
print_hi(5) // output: hihihihihi
print_hi_default() // output: hihihi
print(mult(5, 2)) // output: 10
Imports:
test2.pv:
if __name__ == "main"{ // will be true when file will be runned directly
x = 5
}
else if __name__ == "imported" { // will be true when file is imported
x = 7
}
test1.pv:
x = 6
import test2 // you can also import like this: import "test2.pv"
print(x) // output will be 7
See Examples
Metadata
Release files for pytov 0.3.9
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| pytov-0.3.9.tar.gz | 42.4 kB | Without provenance | Details for pytov-0.3.9.tar.gz |
Release files / pytov-0.3.9.tar.gz
| Download URL | pytov-0.3.9.tar.gz |
|---|---|
| Size | 42.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
f1bd5c2f664bf3bd7dec75119e87f4973a143ee062d419a304ef836c0dcd6ca2
|
|
BLAKE2b-256 checksum How to use checksums |
67f80a242652cf0a016b88ddfb7c48bb9b4ecc974b713d118b8ca2a3656bc201
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.4.1 importlib_metadata/4.6.1 pkginfo/1.7.1 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.8.5
|
Security for pytov 0.3.9
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.