doc [skip ci]
This commit is contained in:
parent
ba8116c898
commit
003f4b0201
1 changed files with 6 additions and 3 deletions
|
|
@ -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
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue