Package: tkconfigeditor
Dynamic tkinter config editor for files created with ConfigParserIf you have a friend or a client who doesn’t know anything about python, but wants to change some settings without touching the py file,you can use tkconfigeditor. Just add it on top of your python file.pip install tkconfigeditorTested against Python 3.9.15 / Windows 10 / Anaconda[mysql]host=localhostuser=user7passwd=s$cretdb=ydb[postgresql]host=localhostuser=user8passwd=mypwd$7db=testdb[dev]api_url=https://gorest.co.in/public/v2/userssave_dir=/Users/dradecic/Desktop/users_datasave_file=users.json[prod]api_url=https://gorest.co.in/public/v2/userssave_dir=/tmp/users_datasave_file=users.json[openweather]api_key=mt732wbt5kh5ea4bkw7qytbb9gdkaew4[twitter]consumer_key=d53Qe4uf5LMWuQeQFFG66n6BNconsumer_secret=Yxf5n2BwnRELRrkkVjWgpTu48sz5KwGD52324PuwkFWdmVGP4maccess_token=9922431-d53Qe4uf5LMWuQeQFFG66n6BNaccess_token_secret=ubfWMR8WYucrzeaQdrqkm6SrhYTMVQSsxZWpNbtUCMX5u[google]api_key=ubfWMR8WYucrzeaQdrqkm6SrhYTMVQSsxZWpNbtUCMX5u[book]title:ThePythonStandardLibraryauthor:FredrikLundhemail:fredrik@pythonware.comversion:2.0-001115[ematter]pages:250[hardcopy]pages:350[DEFAULT]serverthreads=45content_type=text/htmlcontent_length=1024autoscaling=no[website_name.org]username=your_namelogin_mail=your_mail[private.data.com]password=secret_passwordautoscaling=yes[DEFAULT]serverthreads=45content_type=text/htmlcontent_length=1024autoscaling=no[website_name.org]username=your_namelogin_mail=your_maillogin_date=new_date[private.data.com]password=new_passwordautoscaling=yes[new_section]user_port=4098user_request=yes[Common]home_dir:/Userslibrary_dir:/Librarysystem_dir:/Systemmacports_dir:/opt/local[Frameworks]Python:3.2path:${Common:system_dir}/Library/Frameworks/[Arthur]nickname:TwoShedslast_name:Jacksonmy_dir:${Common:home_dir}/twoshedsmy_pictures:${my_dir}/Picturespython_dir:${Frameworks:path}/Python/Versions/${Frameworks:Python}The first time you run it with a new config file, it will create a backup for the default settings:fromtkconfigeditorimportstart_config_and_load_vars,start_config# This function opens the editor and adds the variables of the config file to the global dict.start_config_and_load_vars(cfgfile=r"C:\Users\Gamer\anaconda3\envs\dfdir\initest\cfg7.ini",# the config file, when you run it the first time, it will create a backup for the default settingstitle="Configuration",# window titleicon=r"C:\Users\Gamer\Pictures\5.png",# needs to be png or Noneres="1920x1080",addbuttons=(),# you can add some additional buttonsmainlabelfont=("Helvetica",15,"underline bold italic"),sublabelfont=("Helvetica",14),varfont=("Helvetica",10),buttonfont=("Helvetica",12,"bold italic"),onezeroasboolean=True,# 1 will be added as True to the global dict)# if you want to add a buttonstart_config_and_load_vars(cfgfile=r"C:\Users\Gamer\anaconda3\envs\dfdir\initest\cfg7.ini",title="Configuration",icon=r"C:\Users\Gamer\Pictures\5.png",res="1920x1080",addbuttons=(('Another button',lambda:os.system('start cmd')),),mainlabelfont=("Helvetica",15,"underline bold italic"),sublabelfont=("Helvetica",14),varfont=("Helvetica",10),buttonfont=("Helvetica",12,"bold italic"),onezeroasboolean=True,)# If you don't want to add the variables of the config file to the global dictstart_config(cfgfile=r"C:\Users\Gamer\anaconda3\envs\dfdir\initest\cfg7.ini",title="Configuration",icon=None,res="1024x768",addbuttons=(),mainlabelfont=("Helvetica",15,"underline bold italic"),sublabelfont=("Helvetica",14),varfont=("Helvetica",10),buttonfont=("Helvetica",12,"bold italic"),)