Skip to content

Instantly share code, notes, and snippets.

@zeekay
Created January 30, 2014 08:49
Show Gist options
  • Save zeekay/8704792 to your computer and use it in GitHub Desktop.
Save zeekay/8704792 to your computer and use it in GitHub Desktop.
Python vs Go round 1.
package main
import "fmt"
func ping(c chan string) {
for {
c <- "ping"
}
}
func main() {
c := make(chan string)
go ping(c)
for p := range c {
fmt.Println(p)
}
}
def ping():
while True:
yield "ping"
for p in ping():
print p
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment