You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: binpython.py
+57-21Lines changed: 57 additions & 21 deletions
Original file line number
Diff line number
Diff line change
@@ -1,48 +1,84 @@
1
-
#BINPython By:XINGYUJIE AGPL-V3.0 LECENSE Release
2
-
#Please follow the LICENSE
3
-
ver="0.15-beta"
1
+
"""
2
+
@header binpython.py
3
+
@author xingyujie
4
+
@abstract BINPython main file
5
+
"""
6
+
#BINPython By:XINGYUJIE AGPL-V3.0 LICENSE Release
7
+
#Please follow the LICENSE AGPL-V3
8
+
9
+
####################################
10
+
#configure
11
+
12
+
ver="0.15-stable"
13
+
#Don't change
14
+
15
+
libs_warning="1"
16
+
#1 is ture 0 is false.
17
+
#Changing the value to 0 will close the prompt that the library does not exist
18
+
19
+
releases_ver="offical"
20
+
importlibs="os"#Don't use "import xxx"
21
+
#importlibs="<library>"
22
+
#Imported library name, please use "importlibs="<library name>" instead of "import <library name>"
23
+
24
+
25
+
####################################
26
+
defself_import(name):
27
+
__import__(name)
28
+
try:
29
+
self_import(importlibs)
30
+
exceptImportError:
31
+
iflibs_warning=="1":
32
+
print("Warning: Custom import library %s does not exist, please check the source code library configuration and rebuild"%importlibs)
33
+
print("")
34
+
try:
4
35
#base import
5
-
importgetopt
6
-
importsys
7
-
importplatform
8
-
#fix some libs
9
-
fromsysimportexit
36
+
importgetopt
37
+
importsys
38
+
importplatform
39
+
#fix for exit()
40
+
fromsysimportexit
10
41
#import for http_server
11
-
importhttp.server
12
-
importsocketserver
42
+
importhttp.server
43
+
importsocketserver
13
44
#except ImportError:
14
-
45
+
exceptImportError:
46
+
print("Unable to use any library, the program does not work properly, please rebuild")
15
47
#gui import
16
48
try:
17
49
importtkinter
18
50
importturtle
19
51
#warning for gui
20
52
exceptImportError:
21
-
print("Warning: Some GUI (graphical) libraries for BINPython do not exist, such as tkinter and turtle. Because they are not built when they are built. If you need to fix this warning, please complete the support libraries imported in the source code at build time (use pip or build it yourself), if your system does not support these libraries, you can remove or change this hint in the source code and rebuild")
22
-
print("")
53
+
iflibs_warning=="1":
54
+
print("Warning: Some GUI (graphical) libraries for BINPython do not exist, such as tkinter and turtle. Because they are not built when they are built. If you need to fix this warning, please complete the support libraries imported in the source code at build time (use pip or build it yourself), if your system does not support these libraries, you can remove or change this hint in the source code and rebuild")
55
+
print("")
23
56
24
57
#import math
25
58
try:
26
59
importfractions
27
60
importcmath
28
61
exceptImportError:
29
-
print("Warning: Some math or computation libraries for BINPython do not exist, such as fractions and cmath. 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")
30
-
print("")
62
+
iflibs_warning=="1":
63
+
print("Warning: Some math or computation libraries for BINPython do not exist, such as fractions and cmath. 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")
64
+
print("")
31
65
#rlcompleter
32
66
#import for normal
33
67
try:
34
68
#str
35
69
importrlcompleter
36
70
importarray
37
71
exceptImportError:
38
-
print("Warning: Some libraries for functions, data types, etc. for BINPython do not exist, such as rlcomplter and array. 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")
39
-
print("")
72
+
iflibs_warning=="1":
73
+
print("Warning: Some libraries for functions, data types, etc. for BINPython do not exist, such as rlcomplter and array. 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")
74
+
print("")
40
75
try:
41
76
importfilecmp
42
77
importtempfile
43
78
exceptImportError:
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")
45
-
print("")
79
+
iflibs_warning=="1":
80
+
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")
0 commit comments