1.

How Do I Check If The Current File Is Being Run As The Main Script?

Answer»

When a file is RUN as the main script USING julia file.jl one might want to activate extra FUNCTIONALITY LIKE COMMAND line argument handling. A way to determine that a file is run in this fashion is to check if abspath(PROGRAM_FILE) == @__FILE__ is true.

When a file is run as the main script using julia file.jl one might want to activate extra functionality like command line argument handling. A way to determine that a file is run in this fashion is to check if abspath(PROGRAM_FILE) == @__FILE__ is true.



Discussion

No Comment Found