py4go

command module
v0.0.0-...-7c9f3cf Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 28, 2021 License: MIT Imports: 4 Imported by: 0

README

py4go

transpile python to golang

python code:

def pi():
    return 3.1415
print(2 * pi())

x = 1
def print_x():
    print(x)
    if False: x = 0
print_x()

# Comment x function of x*x or not?
x = ( x + 1) * (x + 3) * 5**8
print(x)

transpiler Go code:

package main

func pi() {
	return 3.1415
}
func print_x() {
	Print(x)
	if False {
		x = 0
	}
}
func main() {
	Print(2 * pi())
	x = 1
	print_x()
	x = (x + 1) * (x + 3) * math.Pow(5, 8)
	Print(x)
}

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL