Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
ruby ファイルの場合、次のように関数を定義します。
def tell_the_truth() puts "truth" end
Pythonのメインに相当するものはありますか?
if __name__ == "__main__": tell_the_truth()
ファイル内の関数を呼び出すだけですか?
tell_the_truth
私はこれがうまくいくと信じています:
if __FILE__ == $0 tell_the_truth() end