reeee configs.py

This commit is contained in:
沈瑗杰 2021-01-25 19:23:16 +08:00
parent 17434f7bd3
commit 5520fb88c6
5 changed files with 25 additions and 14 deletions

View File

@ -16,7 +16,7 @@ def main():
if py_v_info[0] == 2: if py_v_info[0] == 2:
raise Exception("Simple Rocket need python vision 3+") raise Exception("Simple Rocket need python vision 3+")
# start games # start games
game = bin.main.Game() game = bin.bin.main.Game()
if __name__ == "__main__": if __name__ == "__main__":

View File

@ -3,14 +3,24 @@ writen by shenjackyuanjie
mail: 3695888@qq.com mail: 3695888@qq.com
""" """
import re
def basic_number(Int=0, Float=1, unit1=[], unit2=[]):
def basic_number(Int=0, Float=1, unit1=None, unit2=None) -> list:
if unit2 is None:
unit2 = []
if unit1 is None:
unit1 = []
return [Int, Float, unit1, unit2] return [Int, Float, unit1, unit2]
def basic_force(): def basic_force() -> list:
return [basic_number(unit1=["N"]), basic_number(unit1=["N"])] return [basic_number(unit1=["N"]), basic_number(unit1=["N"])]
def configs(name): def configs(name) -> dict:
pass
def name_handler(name: str, configs: dict) -> str:
pass pass

View File

@ -22,12 +22,12 @@ class Game():
self.start_time = time.strftime("%Y-%m-%d %H-%M-%S", time.gmtime(time.time())) self.start_time = time.strftime("%Y-%m-%d %H-%M-%S", time.gmtime(time.time()))
self.configs = '' self.configs = ''
# share memory # share memory
self.dics = share().dict() self.dicts = share().dict()
self.lists = share().list() self.lists = share().list()
# logger # logger
self.server_logger = logging.getLogger('server') self.server_logger = logging.getLogger('server')
self.client_logger = logging.getLogger('client') self.client_logger = logging.getLogger('client')
self.log_file_hander = logging.FileHandler('') self.log_file_handler = logging.FileHandler('')
# client and server # client and server
self.client = client.RenderThread(self.lists, self.dics, self.client_logger, net_mode='local') self.client = client.RenderThread(self.lists, self.dicts, self.client_logger, net_mode='local')
self.server = server.server(self.lists, self.dics, self.server_logger, net_mode='local') self.server = server.server(self.lists, self.dicts, self.server_logger, net_mode='local')

View File

@ -26,14 +26,14 @@ Physics calculation
""" """
def is_decimal(A): def is_decimal(A: any) -> bool:
if type(A) == type(decimal.Decimal): if type(A) == type(decimal.Decimal):
return True return True
else: else:
return False return False
def F_D(A, B): def F_D(A: decimal, B: decimal) -> decimal:
if is_decimal(A) and is_decimal(B): if is_decimal(A) and is_decimal(B):
return A / B return A / B
@ -42,7 +42,7 @@ def F_Mu():
pass pass
def D_C(listA, listB): # stand for Duplicate check def D_C(listA: list, listB: list) -> '1': # stand for Duplicate check
""" """
usage:\n usage:\n
input two list\n input two list\n
@ -57,10 +57,10 @@ def D_C(listA, listB): # stand for Duplicate check
continue continue
listA.sort() listA.sort()
listB.sort() listB.sort()
return return 1
def S_C_float_check(SC): # stand for Scientific notation's float check def S_C_float_check(SC) -> dict: # stand for Scientific notation's float check
""" """
formats: formats:
SC list format:docs.basic_config.json:basic_number""" SC list format:docs.basic_config.json:basic_number"""

View File

@ -17,8 +17,9 @@
'filename': { 'filename': {
'main': '{date} SR.log', 'main': '{date} SR.log',
// {date} -> date // {date} -> date
'{date}': '%Y-%m-%d %H-%M-%S', '{date}': '%Y-%m-%d %H-%M-%S'
// format at https://docs.python.org/zh-cn/3.8/library/time.html#time.strftime // format at https://docs.python.org/zh-cn/3.8/library/time.html#time.strftime
// can and more {xx} by adding more obj EZ
} }
} }
} }