Python的Julia等价物';s";帮助();

Python的Julia等价物';s";帮助();,julia,Julia,在python中,要获取函数的文档,我们可以键入(例如)help(len) 如何在Julia中获取函数的文档?在Julia中,您可以使用问号后跟函数名,即?functionname,以获取有关函数的信息 如果您正在使用,问号将把您的julia>提示符切换为帮助?>提示符-类似于]触发pkg>REPL模式。有关更多信息,请查看 在Jupyter笔记本(IJulia)中,您只需键入?println,并且没有可见的REPL模式更改 例如: help?> println # I typed ?pr

在python中,要获取函数的文档,我们可以键入(例如)
help(len)


如何在Julia中获取函数的文档?

在Julia中,您可以使用问号后跟函数名,即
?functionname
,以获取有关函数的信息

如果您正在使用,问号将把您的
julia>
提示符切换为
帮助?>
提示符-类似于
]
触发
pkg>
REPL模式。有关更多信息,请查看

在Jupyter笔记本(IJulia)中,您只需键入
?println
,并且没有可见的REPL模式更改

例如:

help?> println # I typed ?println
search: println printstyled print sprint isprint

  println([io::IO], xs...)

  Print (using print) xs followed by a newline. If io is not supplied, prints to stdout.

  Examples
  ≡≡≡≡≡≡≡≡≡≡

  julia> println("Hello, world")
  Hello, world

  julia> io = IOBuffer();

  julia> println(io, "Hello, world")

  julia> String(take!(io))
  "Hello, world\n"
注意,这种方法并不局限于函数。它适用于所有附加了某些文档字符串的对象:

help?> Sys.CPU_THREADS # docstring of a constant
  Sys.CPU_THREADS

  The number of logical CPU cores available in the system, i.e. the number of threads that the CPU can run concurrently. Note that this is not necessarily the number of CPU cores, for example, in the presence of hyper-threading (https://en.wikipedia.org/wiki/Hyper-threading).

  See Hwloc.jl or CpuId.jl for extended information, including number of physical cores.