#^^^^^^^^^^^^
#creat 'settings', a persistent settings object
#note that the 'filename' argument is required
#the directory for the persistet file must already exist
#^^^^^^^^^^^^
import os
import easygui as g
#we initialize the 'user' and 'server' variables
#in a real application, we'd probaly have the user enter them via enterbox
user = 'Obama'
server = 'WhiteHouse'
class settings:
userId = user
targetServer = server
def store(self):
pass
settingsFilename = os.path.join('E:','FishCApp','settings.txt') #windows example
settings = settings(settingsFilename)
#we save the variables as attriutes of the 'settings' object
settings.userId = user
settings.targetServer = server
settings.store() #persist the settings
#run code that gets a new value for userId
#then persist the settings with the new value
user = 'cc'
settings.userId = user
settings.srore()
#^^^^^^^^^^^^
#creat 'settings', a persistent settings object
#note that the 'filename' argument is required
#the directory for the persistet file must already exist
#^^^^^^^^^^^^
import os
import easygui as g
#we initialize the 'user' and 'server' variables
#in a real application, we'd probaly have the user enter them via enterbox
user = 'Obama'
server = 'WhiteHouse'
class settings:
userId = user
targetServer = server
def store(settings):
#pass
settingsFilename = os.path.join('E:','FishCApp','settings.txt') #windows example
settings = settings(settingsFilename)
#we save the variables as attriutes of the 'settings' object
settings.userId = user
settings.targetServer = server
settings.store() #persist the settings
#run code that gets a new value for userId
#then persist the settings with the new value
user = 'cc'
settings.userId = user
settings.srore()