GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — python-script-compressor/compress_python_scripts.py at main · codassassin/python-script-compressor

Expand file tree

/

compress_python_scripts.py

Copy path
More file actions
More file actions

Latest commit

 

History

History
History
62 lines (49 loc) · 2.14 KB
/

compress_python_scripts.py

Copy path

File metadata and controls

62 lines (49 loc) · 2.14 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
import argparse
import os
import sys
def banner():
print('<<< PythonScript-Compressor v1.0>>>')
print(r'''
_
| |
| |___
| _ \ _ _
| |_) | (_) |
\____/ \__, |
__/ |
|___/
_ _
| | (_)
____ ____ ___| | ___ _ ______ ______ ___ _ ______ ______ _ _ ____
/ ___\ / \ / _ | / _ | | / ____| / ____| / _ | | / ____| / ____| | | | | | \
| |____ | () | | (_| | | (_|| | \_____ \ \_____ \ | (_|| | \_____ \ \_____ \ | | | | | |
\____/ \____/ \____/ \___|_| |______/ |______/ \___|_| |______/ |______/ |_| |_| |_|
''')
if __name__ == '__main__':
banner()
try:
parser = argparse.ArgumentParser()
parser.add_argument("script", type=str)
args = parser.parse_args()
if not os.path.exists(args.script):
sys.stderr.write(f"'{args.script}' not a file")
with open(args.script, "rb") as h:
contents = h.read().decode('utf-8')
code = "+".join([f"chr({ord(x)})" for x in contents])
code = f"{code}"
script = "+".join([f"chr({ord(x)})" for x in "<script>"])
script = f"{script}"
executable = "+".join([f"chr({ord(x)})" for x in "exec"])
executable = f"{executable}"
compressedCommand = f'python -c "exec(compile({code}, {script}, {executable}))"'
with open('scripts.csv', 'r+') as f:
myDataList = f.readlines()
nameList = []
for line in myDataList:
entry = line.split(',')
nameList.append(entry[0])
if args.script not in nameList:
f.writelines(f'\n{args.script},{compressedCommand}')
print("[+] The compressed command is: (just copy the command and run)\n\t" + compressedCommand)
except Exception as e:
print(f"[-] ERROR: {e}")
You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.