Python Forum
variables help / update config file
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
variables help / update config file
#1
In my python script I have way too many default variables / parameter options. What is the best practice for moving these default variables into a config file that the users can update? This config file will be global variables that my main script will read and apply each time it's run.

config file:
x = 1
y = 2

main script:
import config file
sum = x + y

Please comment with the best practices for dealing with updateable config files for variables so the default values arent used each time. Thanks.
Reply


Messages In This Thread
variables help / update config file - by mapvis - Nov-27-2018, 05:16 AM
RE: variables help / update config file - by buran - Nov-27-2018, 07:19 AM
RE: variables help / update config file - by mapvis - Nov-27-2018, 02:24 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  File path by adding various variables Mishal0488 2 1,089 Apr-28-2023, 07:17 PM
Last Post: deanhystad
  How to read csv file update matplotlib column chart regularly SamLiu 2 1,109 Jan-21-2023, 11:33 PM
Last Post: SamLiu
  Is it possible to update a CSS file from Python bigAL_python 4 2,344 Apr-20-2022, 01:38 PM
Last Post: bigAL_python
  Storing variables into one file for use in multiple Jupyter notebooks devansing 1 1,788 Feb-05-2022, 10:04 AM
Last Post: ibreeden
  value null when update in json file 3lnyn0 6 3,402 Dec-30-2021, 05:52 PM
Last Post: ndc85430
  Updating a config file [solved] ebolisa 8 2,656 Nov-04-2021, 10:20 AM
Last Post: Gribouillis
  |SOLVED] Glob JPGs, read EXIF, update file timestamp? Winfried 5 2,545 Oct-21-2021, 03:29 AM
Last Post: buran
  Is there a library for recursive object creation using config objects johsmi96 0 1,874 May-03-2021, 08:09 PM
Last Post: johsmi96
  help with pytesseract.image_to_string(savedImage, config='--psm 11')iamge to string korenron 0 2,732 Apr-29-2021, 10:08 AM
Last Post: korenron
Question Python + Google Sheet | Best way to update specific cells in a single Update()? Vokofe 1 2,725 Dec-16-2020, 05:26 AM
Last Post: Vokofe

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020