|
1 | 1 | #BINPython By:XINGYUJIE AGPL-V3.0 LECENSE Release |
2 | 2 | #Please follow the LICENSE |
3 | | -ver="0.15-canary" |
| 3 | +ver="0.15-beta" |
4 | 4 | #base import |
5 | 5 | import getopt |
6 | 6 | import sys |
7 | 7 | import platform |
| 8 | +#fix some libs |
| 9 | +from sys import exit |
8 | 10 | #import for http_server |
9 | 11 | import http.server |
10 | 12 | import socketserver |
|
41 | 43 | except ImportError: |
42 | 44 | print("Warning: Some file manipulation libraries for BINPython do not exist, such as filecmp and tempfile. Because they weren't built when they were built. If you need to fix this warning, please complete the support libraries imported in the source code when building (use pip or build it yourself), if your system does not support these libraries, you can remove or change this prompt in the source code and rebuild") |
43 | 45 | print("") |
44 | | -#getopt |
45 | | -opts,args = getopt.getopt(sys.argv[1:],'-h-f:-s:-v',['help','file','server','version']) |
46 | | -for opt_name,opt_value in opts: |
47 | | - if opt_name in ('-h','--help'): |
48 | | - print("[*] Help info") |
49 | | - print(""" |
| 46 | +#def |
| 47 | +def help(): |
| 48 | + print("[*] BINPython Help") |
| 49 | + print(""" |
50 | 50 | -h --help View this help |
51 | | --f --file Enter Python Filename and run |
52 | | --s. --server Start a simple web server that supports html and file transfer (http.server) |
| 51 | +-f --file <filename> Enter Python Filename and run |
| 52 | +-s. --server <port> Start a simple web server that supports html and file transfer (http.server) |
53 | 53 | -v --version View BINPython Version |
54 | 54 | """) |
| 55 | + |
| 56 | +#getopt |
| 57 | +try: |
| 58 | + opts,args = getopt.getopt(sys.argv[1:],'-h-f:-s:-v',['help','file','server','version']) |
| 59 | +except: |
| 60 | + print("Please check help:") |
| 61 | + help() |
| 62 | + print("The parameters you use do not exist or are not entered completely, please check help! ! ! ! !") |
| 63 | +for opt_name,opt_value in opts: |
| 64 | + if opt_name in ('-h','--help'): |
| 65 | + help() |
55 | 66 | sys.exit() |
56 | 67 | if opt_name in ('-v','--version'): |
57 | 68 | print("BINPython " + ver + " By:XINGYUJIE[https://github.com/xingyujie/binpython] AGPL-3.0 LICENSE Release") |
|
0 commit comments