使用 Python,我们可以像这样使用dir()和help():>>> import random>>> dir(random)['BPF', 'LOG4', 'NV_MAGICCONST', 'RECIP_BPF', 'Random', 'SG_MAGICCONST', 'SystemRandom', 'TWOPI', '_BuiltinMethodType', '_MethodType', '_Sequence', '_Set', '__all__', '__builtins__', '__cached__', '__doc__', '__file__', '__loader__', '__name__', '__package__', '__spec__', '_acos', '_bisect', '_ceil', '_cos', '_e', '_exp', '_inst', '_itertools', '_log', '_os', '_pi', '_random', '_sha512', '_sin', '_sqrt', '_test', '_test_generator', '_urandom', '_warn', 'betavariate', 'choice', 'choices', 'expovariate', 'gammavariate', 'gauss', 'getrandbits', 'getstate', 'lognormvariate', 'normalvariate', 'paretovariate', 'randint', 'random', 'randrange', 'sample', 'seed', 'setstate', 'shuffle', 'triangular', 'uniform', 'vonmisesvariate', 'weibullvariate']>>> help(random.randint)Help on method randint in module random:randint(a, b) method of random.Random instance Return random integer in range [a, b], including both end points.是否有 Pythondir()和help()Go 之类的实用程序?
1 回答
慕雪6442864
TA贡献1812条经验 获得超5个赞
你寻求的是go doc。
go doc fmt.Printf
当前产生输出:
package fmt // import "fmt"
func Printf(format string, a ...interface{}) (n int, err error)
Printf formats according to a format specifier and writes to standard
output. It returns the number of bytes written and any write error
encountered.
您可能还对godoc感兴趣,它将为您的 GOPATH 中的任何内容生成文档,甚至可以运行 http 服务器在本地浏览它。
- 1 回答
- 0 关注
- 232 浏览
添加回答
举报
0/150
提交
取消