Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ------------COSA VOGLIO------------
- {
- "program": {
- "firstExecute": "true"
- },
- "messages": {
- "startMessage": "- Hello from PasswordRemainder.\n--> Digit '/start' to init\n--> Digit /exit to end the exectuion.",
- "pinInsert": "Before start type a name and a pin. (Pin = only integers password)",
- "exitMessage": "Have a good day ;D. Remaind the pin!!!"
- }
- "user": {[
- "name": nomeinserito,
- "pin": pininserito
- ]}
- }
- --------SCRIPT---------
- with open(f'{self.dir}/settings.json') as settings:
- jsonSettings = json.load(settings)
- jsonSettings['program']['firstExecute'] = "false"
- with open(f'{self.dir}/settings.json', 'a') as output:
- jsonSettings['user'] = []
- jsonSettings['user'].append({"name": name, "pin": pin})
- json.dump(jsonSettings, output, indent=2)
- ---------JSON---------
- {
- "program": {
- "firstExecute": "true"
- },
- "messages": {
- "startMessage": "- Hello from PasswordRemainder.\n--> Digit '/start' to init\n--> Digit /exit to end the exectuion.",
- "pinInsert": "Before start type a name and a pin. (Pin = only integers password)",
- "exitMessage": "Have a good day ;D. Remaind the pin!!!"
- }
- }
- -------------RIUSLTATO-------------
- {
- "program": {
- "firstExecute": "true"
- },
- "messages": {
- "startMessage": "- Hello from PasswordRemainder.\n--> Digit '/start' to init\n--> Digit /exit to end the exectuion.",
- "pinInsert": "Before start type a name and a pin. (Pin = only integers password)",
- "exitMessage": "Have a good day ;D. Remaind the pin!!!"
- }
- }{
- "program": {
- "firstExecute": "false"
- },
- "messages": {
- "startMessage": "- Hello from PasswordRemainder.\n--> Digit '/start' to init\n--> Digit /exit to end the exectuion.",
- "pinInsert": "Before start type a name and a pin. (Pin = only integers password)",
- "exitMessage": "Have a good day ;D. Remaind the pin!!!"
- },
- "user": [
- {
- "name": "123",
- "pin": 123
- }
- ]
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement