PHP
if (realpath($argv[0]) == __FILE__) { #code some_code(); }
Ruby
if __FILE__ == $0 #code some_code end
Python
if __name__ == '__main__': #code some_code()
Recommended Posts