使用 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 關注
- 259 瀏覽
添加回答
舉報
0/150
提交
取消