Questions tagged [shelve]

Shelve can refer to either a Python object persistence or a pending change in a Visual Studio Workspace

A shelf in Python is a persistent, dictionary-like object. Documentation: shelve

Shelve can also refer to a pending change in the workspace within Visual Studio 2005

351 questions
-2
votes
1 answer

How to keep and run the program always form the last value, so when I open again the program starts from the last amount

import random amount = 100 loggedOn = True while loggedOn: selection = int(input("Select 1 for Deposit, 2 for Withdraw or 3 for Exit: ")) if not selection: break if selection == 1: deposit = float(input("How much will…
-2
votes
1 answer

Sorting a shelve file first by key then by value. No imported module

So I'm creating some objects with information from a CSV file like that: def ajouter_morceaux_csv(db,csv): data_csv= read_data(csv) for i in range(len(data_csv[0])): titre = data_csv[0][i] année = data_csv[1][i] …
Felix Dumitrascu
  • 115
  • 1
  • 10
-2
votes
2 answers

Python, Tkinter - How to run 'shelve.close ()' when exiting the gui program?

I have a simple gui(tkinter) program that writes data to a file. Uses shelve. How to run shelve.close () when I want to disable the program?
Mr Korni
  • 41
  • 4
-2
votes
1 answer

Why is Filename not a db that the shelve module can open?

import random import sys import shelve def get_input_or_quit(prompt, quit="Q"): prompt += " (Press '{}' to exit) : ".format(quit) val = input(prompt).strip() if val.upper() == quit: sys.exit("Goodbye") return val def…
Ibrahim
  • 7
  • 5
-2
votes
1 answer

TFS Eclipse for Selenium (Shelving changes or labeling)

We are working on doing selenium automation and use Eclipse with TFS plug-in. We have two teams Automation team which creates the test on the devlopment build and Functional team which runs the test on the released build. So for example I have files…
Rahul
  • 11
  • 2
-3
votes
1 answer

I am using shelve to append and add to dictionaries, but it won't work

import shelve name = input('Please enter your name: ') reg = input(Please enter the registration plate: ') speed = input(Please enter the speed: ') Dictionary = {name:{reg:speed}} db = shelve.open('Data') db['Stuff'].append(Dictionary) db.close f…
1 2 3
23
24