我在Solaris 10(x86)上.
到现在为止,我使用的是python2.6.今天,我安装了python2.7,在2.7上导入hashlib时发生了一个奇怪的错误,但在2.6上没有:
Python 2.6:
root@myserver [PROD] # python2.6 -c "import hashlib"
root@myserver [PROD] #
Run Code Online (Sandbox Code Playgroud)
Python 2.7:
root@myserver [PROD] # python2.7 -c "import hashlib"
ERROR:root:code for hash md5 was not found.
Traceback (most recent call last):
File "/usr/local/lib/python2.7/hashlib.py", line 139, in <module>
globals()[__func_name] = __get_hash(__func_name)
File "/usr/local/lib/python2.7/hashlib.py", line 91, in __get_builtin_constructor
raise ValueError('unsupported hash type ' + name)
ValueError: unsupported hash type md5
ERROR:root:code for hash sha1 was not found.
Traceback (most recent call last):
File "/usr/local/lib/python2.7/hashlib.py", line 139, in …
Run Code Online (Sandbox Code Playgroud) 我正在学习Go,我想尝试goroutines和频道.
这是我的代码:
package main
import "fmt"
func main(){
messages := make(chan string,3)
messages <- "one"
messages <- "two"
messages <- "three"
go func(m *chan string) {
fmt.Println("Entering the goroutine...")
for {
fmt.Println(<- *m)
}
}(&messages)
fmt.Println("Done!")
}
Run Code Online (Sandbox Code Playgroud)
这是结果:
Done!
Run Code Online (Sandbox Code Playgroud)
我不明白为什么我的goroutine永远不会被执行.没有打印"输入goroutine",我没有任何错误消息.