The whole package of main function similar to the following code, the file name. The main py, CD to the console file path. After running the main py, can only open the file, don't know how to through the console call the main function? Admin. Welcome () will call other modules, it also has other functions, hope can console calls,
Thank you very much!
the import the OSThe import sys
Base_Dir=OS. The path. The dirname (OS) path) dirname (OS) path) abspath (__file__)))
Sys. Path. Append (Base_Dir)
From the core import memo, memo_admin_config
Def the main () :
Is_name=input (' please enter the username: ')
Me=memo. Memo (is_name 'date', 'thing')
Admin=memo_admin_config. MemoAdmin (me, f '{Base_Dir} \ conf', 'config. Ini')
Admin. Welcome ()
If __name__=="__main__" :
The main ()
CodePudding user response:
Generate a temporary py file, the file content is to import the model you need to run the py files, call the function model. The function ()CodePudding user response: