Logo

Programming-Idioms

This language bar is your friend. Select your favorite languages!
  • Python
import sys
s = sys.argv[0]

sys.argv[0] holds the name of the currently running script, you might use __file__, but if called from within a module you would then get the module's __file__ attribute.
with Ada.Command_Line; use Ada.Command_Line;
with Ada.Directories; use Ada.Directories;
S : String := (Simple_Name (Command_Name));

New implementation...
< >
programming-idioms.org