diff options
Diffstat (limited to 'main.py')
| -rwxr-xr-x | main.py | 13 |
1 files changed, 7 insertions, 6 deletions
@@ -1,19 +1,20 @@ #!/usr/bin/env python -from sys import argv, executable -from os import execv, path +from sys import argv +from os.path import islink, dirname, abspath +from stdlib import runutil -if path.islink(__file__): +if islink(__file__): from os import readlink file = readlink(__file__) else: file = __file__ -cwd = path.dirname(path.abspath(file)) +cwd = dirname(abspath(file)) def write(): - execv(executable, ['python3', f'{cwd}/write.py']) + runutil("write.py") def read(): - execv(executable, ['python3', f'{cwd}/read.py']) + runutil("read.py") if len(argv) > 1: if argv[1] == 'write': write() |
