doc [skip ci]

This commit is contained in:
Michiel Borkent 2020-06-27 13:39:06 +02:00
parent ba8116c898
commit 003f4b0201

View file

@ -575,9 +575,12 @@ Babashka sets the following system properties:
## `__name__ = "__main__"` pattern ## `__name__ = "__main__"` pattern
In Python scripts there is a well-known pattern to check if the current file was In Python scripts there is a well-known pattern to check if the current file was
the file invoked from the command line: `__name__ = "__main__" pattern`. In the file invoked from the command line, or loaded from another file: the
babashka this pattern can be implemented using `(= *file* (System/getProperty `__name__ = "__main__"` pattern. In babashka this pattern can be implemented with:
"babashka.file")`.
``` clojure
(= *file* (System/getProperty "babashka.file")
```
## Data readers ## Data readers