forked from evereux/pycatia
-
Notifications
You must be signed in to change notification settings - Fork 0
/
pycatia-exe.py
43 lines (33 loc) · 1.35 KB
/
pycatia-exe.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
# !/usr/bin/python3.10
"""
This script is strictly for the use of generating the pycatia.exe executable.
"""
import argparse
import sys
import textwrap
from pathlib import Path
from pycatia.version import version
if __name__ == "__main__":
prog = "pycatia"
parser = argparse.ArgumentParser(
formatter_class=argparse.RawDescriptionHelpFormatter,
description=textwrap.dedent('''\
=====================================================================
pycatia
=====================================================================
This executable is currently provided for testing purposes only.
Documentation: https://pycatia.readthedocs.io/en/latest/
=====================================================================
'''),
prog=prog,
usage="pycatia.exe file_name.py")
parser.add_argument("filename",
type=str,
help="The full path filename of the python script file.")
parser.add_argument('--version', action='version', version=f'{prog} {version}')
filename = Path(parser.parse_args().filename)
if filename.exists():
import pycatia
exec(open(filename).read())
else:
raise FileNotFoundError(f'Could not find file "{filename}". Try using the full path name.')