projects
/
python_utils.git
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
history
|
raw
|
HEAD
Clean up more docs to work with sphinx.
[python_utils.git]
/
misc_utils.py
1
#!/usr/bin/env python3
2
3
# © Copyright 2021-2022, Scott Gasch
4
5
"""Miscellaneous utilities."""
6
7
import os
8
9
10
def is_running_as_root() -> bool:
11
"""Returns True if running as root.
12
13
>>> is_running_as_root()
14
False
15
"""
16
return os.geteuid() == 0
17
18
19
if __name__ == '__main__':
20
import doctest
21
22
doctest.testmod()