Re: [Tutor] conventions for establishing and saving default values for variables

2010-06-16 Thread R. Alan Monroe
> On Tue, Jun 15, 2010 at 2:27 PM, Pete O'Connell > wrote: >> Hi I was wondering if anyone could give me some insight as to the best way >> to get and save variables from a user the first time a script is opened. For >> example if the script prompts something like "What is the path to the >> fold

Re: [Tutor] conventions for establishing and saving default valuesfor variables

2010-06-16 Thread Alan Gauld
"R. Alan Monroe" wrote directory, I suppose. Under windows, probably the registry. There's the _winreg and configparser modules. Consider using the %USERPROFILE% environment variable rather than the registry. How would that work? That is just a single variable that points to the users Se

Re: [Tutor] conventions for establishing and saving default values for variables

2010-06-16 Thread Jeff Johnson
Pete O'Connell wrote: Hi I was wondering if anyone could give me some insight as to the best way to get and save variables from a user the first time a script is opened. For example if the script prompts something like "What is the path to the folder?" and the result is held in a variable calle

[Tutor] How to model objects aimed to persistence?

2010-06-16 Thread Knacktus
Hi everyone, within a python application I can easily model object association with simple references, e.g.: # class FavoritMovies(object): def __init__(self, movies): self.movies = movies class Movie(object): def

Re: [Tutor] How to model objects aimed to persistence?

2010-06-16 Thread Mark Lawrence
On 16/06/2010 21:39, Knacktus wrote: Hi everyone, within a python application I can easily model object association with simple references, e.g.: # class FavoritMovies(object): def __init__(self, movies): self.movies = movies clas

Re: [Tutor] conventions for establishing and saving default values for variables

2010-06-16 Thread Steven D'Aprano
On Thu, 17 Jun 2010 03:44:58 am Jeff Johnson wrote: > I will send you my python script that reads and writes to a windows > style .ini file if you want me to. How is your script different from the standard ConfigParser module? -- Steven D'Aprano ___

Re: [Tutor] conventions for establishing and saving default valuesfor variables

2010-06-16 Thread Steven D'Aprano
On Thu, 17 Jun 2010 03:25:03 am Alan Gauld wrote: > "R. Alan Monroe" wrote > > >> directory, I suppose. Under windows, probably the registry. > >> There's the _winreg and configparser modules. > > > > Consider using the %USERPROFILE% environment variable rather than > > the > > registry. > > How w

Re: [Tutor] How to model objects aimed to persistence?

2010-06-16 Thread Steven D'Aprano
On Thu, 17 Jun 2010 06:39:44 am Knacktus wrote: > So far, so good. But what is best practise to prepare this data for > general persistence? It should be usable for serialisation to xml or > storing to an RDBMS or ObjectDatabase ... Oh wow, deja vu... this is nearly the same question as just aske

Re: [Tutor] How to model objects aimed to persistence?

2010-06-16 Thread Alan Gauld
"Steven D'Aprano" wrote Deliberate misspellings in class and variable names will cost you *far* more in debugging time when you forget to misspell the words than they will save you in typing. Trust me on this. I don't normally do "me too" postings but this is such a big deal that I just ha

Re: [Tutor] Tkinter - master attribute

2010-06-16 Thread Jim Byrnes
ALAN GAULD wrote: I still am having trouble understanding the use of "master" in Tkinter. I think the problem is I can't find any reference that explains the concept around master, If you read the GUI topic in my tutorial it explains the concept of a containment tree that is common to ost GU

[Tutor] pickling/shelve classes

2010-06-16 Thread Payal
Hi all, Can someone please help in this below? class F(object) : ...: def __init__(self, amt) : self.amt = amt ...: def dis(self) : print 'Amount : ', self.amt ...: def add(self, na) : ...: self.amt += na ...: F.dis(self) pickle.dumps(F) gives PicklingEr

Re: [Tutor] How to model objects aimed to persistence?

2010-06-16 Thread Knacktus
Am 17.06.2010 02:17, schrieb Alan Gauld: "Steven D'Aprano" wrote Deliberate misspellings in class and variable names will cost you *far* more in debugging time when you forget to misspell the words than they will save you in typing. Trust me on this. Thanks for that hint. I can imagine the ni