Pygolang Home Pygolang

    Pygolang FAQ

    • Last Update:2020-05-25
    • Version:001
    • Language:en

    FAQ

    Q: Which Go version is recommended?
    A: Pygolang does not depend on Go as it implements its runtime by itself.

    Q: How to install?
    A: pip install pygolang

    Q: How to run a simple Hello World?
    A: As Pygolang is just a Python library a "hello world" example is just print("hello world"). However below is "hello world" example that says "hello" and "world"  from two goroutines similarly to https://tour.golang.org/concurrency/1:

    from golang import go
    from golang import time
    
    def say(s):
        for i in range(5):
            time.sleep(100 * time.millisecond)
            print(s)
    
    def main():
        go(say, "world")
        say("hello")
    
    if __name__ == '__main__':
        main()