gpt4 book ai didi

python - Ruby 相当于 Python __main__

转载 作者:太空狗 更新时间:2023-10-29 17:55:14 24 4
gpt4 key购买 nike

<分区>

如果在 ruby​​ 文件中我定义了这样一个函数:

def tell_the_truth()
puts "truth"
end

是否有与 python 的 main 等效的东西?

if __name__ == "__main__":
tell_the_truth()

是不是直接调用文件里面的函数?

tell_the_truth

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com