How to convert Python code to Golang!

Manpreet Singh
5 min readJun 24, 2021

Welcome back! Python and Go (Golang) are super popular programming languages with tons of capability, but what if there was a way to convert your Python scripts to Go code, well now there actually is! There is a package called Pytago that does exactly this, check out the link below to access this package on GitHub:

This specific package is broken down into several different files, but you can install this package using this pip command:

pip install pytago

To use the following package, we follow their usage example on their page:

Within their GitHub page they break down a ton of examples of Python code converted to Go code, below is the hello world example converted from Python to Go using this package:

Python:

def main():
print("hello world")


if __name__ == '__main__':
main()

--

--