ecookbook restoring the folders for testing...

This commit is contained in:
PySimpleGUI 2022-06-30 15:54:57 -04:00
parent 0574702876
commit 9f40a47d30
109 changed files with 0 additions and 0 deletions

View file

@ -0,0 +1,24 @@
## UserSettings APIs
In addition to the JSON file format, new in release 4.50.0 is the support of INI files.
This file format is a little different than JSON. INI Files have a concept of "Sections" where JSON does not. In PySimpleGUI the UserSettings API calls and use of the `UserSettings` object are very similar.
This demo shows how to use the UserSettings obiject to interface with these INI files. It's as easy as this to write a setting value:
```python
settings = sg.UserSettings(use_config_file=True)
settings['Section']['setting'] = 'Some Value'
```
And reading is just as easy:
```python
value = settings['Section']['setting']
```
<iframe src='https://trinket.io/embed/pygame/56be5635d8?start=result' width='100%' height='500' frameborder='0' marginwidth='0' marginheight='0' allowfullscreen></iframe>

View file

@ -0,0 +1,8 @@
## UserSettings as a Simple Database
The UserSettings API can be used to store data like you would find in a database. Each entry in a UserSetting entry is a key to some data. In the case of this databsae example, that data is another dictionary that contains infomation about the entry.
Tbis Demo Program shows a simple database that uses a "User ID" as the key, and there are a number of informational fields associated with each UserID. This informatoin is stored as a dictionary to make accessing the data simple.
<iframe src='https://trinket.io/embed/pygame/d559206884?start=result' width='100%' height='600' frameborder='0' marginwidth='0' marginheight='0' allowfullscreen></iframe>