Skip to content

Commit c124543

Browse files
authored
0.15-beta
Fix many bugs Fix exit() ...
1 parent 54f265c commit c124543

File tree

1 file changed

+20
-9
lines changed

1 file changed

+20
-9
lines changed

binpython.py

Lines changed: 20 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
#BINPython By:XINGYUJIE AGPL-V3.0 LECENSE Release
22
#Please follow the LICENSE
3-
ver="0.15-canary"
3+
ver="0.15-beta"
44
#base import
55
import getopt
66
import sys
77
import platform
8+
#fix some libs
9+
from sys import exit
810
#import for http_server
911
import http.server
1012
import socketserver
@@ -41,17 +43,26 @@
4143
except ImportError:
4244
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")
4345
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("""
5050
-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)
5353
-v --version View BINPython Version
5454
""")
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()
5566
sys.exit()
5667
if opt_name in ('-v','--version'):
5768
print("BINPython " + ver + " By:XINGYUJIE[https://github.com/xingyujie/binpython] AGPL-3.0 LICENSE Release")

0 commit comments

Comments
 (0)