instead set to the module name); there are many variants of this structure: import sys def main(argv): n = int(argv[1]) print(n + 1) if __name__ == '__main__': sys.exit(main(sys.argv)) In this idiom, the call to the named entry point main is explicit, and the interaction with the operating system (receiving the arguments, calling system exit) are done explicitly by library calls, which are ultimately handled by the Python runtime. This contrast with C, where these are done implicitly by the runtime, based on convention. QB64 The QB64 language has no main function, the code that is not within a function, or subroutine is executed first, from top to bottom: print "Hello World! a ="; a = getInteger(1.8d): print a function getInteger(n as double) getInteger = int(n) end function Command line arguments (if any) can be read using the COMMAND$ function: dim shared commandline as string commandline = COMMAND$ 'Several space-separated command line arguments can be read using COMMAND$(n) commandline1 = COMMAND$(2) Ruby In Ruby, there is no distinct main function. Instead, code written outside of any class .. end or module .. end scope is executed in the context of a special "main" object. This object can be accessed using self: irb(main):001:0> self => main It has the following properties: irb(main):002:0> self.class => Object irb(main):003:0> self.class.ancestors => [Object, Kernel, BasicObject] Methods defined outside of a class or module scope are defined as private methods of the "main" object. Since the class of "main" is Object, such methods become private methods of almost every object: irb(main):004:0> def foo irb(main):005:1> 42 irb(main):006:1> end => nil irb(main):007:0> foo => 42 irb(main):008:0> [].foo NoMethodError: private method `foo' called for []:Array from (irb):8 from /usr/bin/irb:12:in `<main>' irb(main):009:0> false.foo NoMethodError: private method `foo' called for false:FalseClass from (irb):9 from /usr/bin/irb:12:in `<main>' The number and values of command-line arguments can be determined using the ARGV constant array: $ irb /dev/tty foo bar tty(main):001:0> ARGV ARGV => ["foo", "bar"] tty(main):002:0> ARGV.size ARGV.size => 2 The first element of ARGV, ARGV[0], contains the first command-line argument, not the name of program executed, as in C. The name of program is available using $0 or $PROGRAM_NAME. Similar to Python, one could use: if == $PROGRAM_NAME # Put "main" code here end to execute some code only if its file was specified in the ruby invocation. Rust In Rust, the entry point of a program is a function named main. Typically, this