#Changing the value to 0 will close the prompt that the library does not exist
buildversion="plus"#plus version and standard version
releases_ver="offical"+buildversion+"-building"
importlibs="os"#Don't use "import xxx"
#Imported library name, please use "importlibs="<library name>" instead of "import <library name>"
#Please note: The "importlibs" function does not support loading functions (such as from xxxx import xxxx, if necessary, please write it in the following location. However, please note that this operation may have the risk of error reporting, please report issues or solve it yourself
#xxxxxxxxxxxxxx
#from xxxx import xxxx
#xxxxxxxxxxxxxx
####################################
#BINPython function and variable START
classbinpythoninfo:
defver():
print(ver)
defbuildversion():
print(buildversion)
deflibs_warning():
print(libs_warning)
defreleases_ver():
print(releases_ver)
defbuild_importlibs():
print(importlibs)
#get system info(windows or linux ...)
importplatform
sys=platform.system()
#if system is windows, then enable setwindowtitle() function
print("ver: "+ver+" buildversion: "+buildversion+" libs_warning settings:"+libs_warning+" releases full version: "+releases_ver+" custom library that has been build: "+importlibs)
print("Warning: Custom import library %s does not exist, please check the source code library configuration and rebuild"%importlibs)
print("")
#run python files option(-f)
defoptreadfile():
importsys
getfile=sys.argv[1]
getfilecode=open(getfile,encoding="utf-8")
exec(getfilecode.read())
input("Run finished. Enter to Shell.")
sys.exit(0)
try:
#base import
importgetopt
importsys
importplatform
importos
importtimeit
importpdb
#fix for exit()
fromsysimportexit
#import for http_server
importhttp.server
importsocketserver
#except ImportError:
exceptImportError:
print("Unable to use any library, the program does not work properly, please rebuild")
#gui import
try:
importtkinter
importtkinterastk
fromtkinterimport*
importturtle
defimportpygame():
importpygame
importpygame.locals
importpyglet
null=importpygame
#warning for gui
exceptImportError:
iflibs_warning=="1":
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")
print("")
#import math
try:
importfractions
importcmath
exceptImportError:
iflibs_warning=="1":
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")
print("")
#import for normal
try:
#str
importrlcompleter
importarray
importxlrd
exceptImportError:
iflibs_warning=="1":
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")
print("")
try:
importfilecmp
importtempfile
exceptImportError:
iflibs_warning=="1":
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")
The service starts on port 22948 (http), the program will automatically open the browser, if not, please manually open http://localhost:22948 in the browser
""")
#open browser
webbrowser.open("http://localhost:22940")
#IDE Plus main
defline():
put_text('_______________________',
sep=' '
)
#set bootstrap ui(bar)
defhead():
set_env(title="BINPython IDE Plus", auto_scroll_bottom=True)