Re: [Tutor] Tkinter Entry field text

2011-09-10 Thread Wayne Werner
On Thu, Sep 8, 2011 at 9:31 PM, brandon w wrote: > How do you display text in a Entry field and have it disappear when a > person clicks in it? > To get text into this box the person must first delete > what is already in there. > > Python 2.6.6 > Think about the process. You're already mostly

Re: [Tutor] need advice about a dictionary ({})

2011-09-10 Thread Richard D. Moores
So I've done quite a bit more work. With phone_book.py the user can not only access phone numbers by the person's initials, but can add items to the data file. I've also solved the problem of adding a person who's initials have already been used in a key. I've pasted phone_book_for_pasting.py at <

[Tutor] databases

2011-09-10 Thread Andre' Walker-Loud
Hi All, I am completely new to databases as well as using python to access/create databases. I started googling about it and found so much info, I wasn't sure where to begin to answer my first question. So I thought I would query this group by asking a question I am sure has been asked before

Re: [Tutor] need advice about a dictionary ({})

2011-09-10 Thread Jack Trades
On Sat, Sep 10, 2011 at 1:08 PM, Richard D. Moores wrote: > So I've done quite a bit more work. With phone_book.py the user can > not only access phone numbers by the person's initials, but can add > items to the data file. I've also solved the problem of adding a > person who's initials have alre

Re: [Tutor] databases

2011-09-10 Thread James Reynolds
On Sat, Sep 10, 2011 at 3:39 PM, Andre' Walker-Loud wrote: > Hi All, > > I am completely new to databases as well as using python to access/create > databases. I started googling about it and found so much info, I wasn't > sure where to begin to answer my first question. So I thought I would que

Re: [Tutor] databases

2011-09-10 Thread Andre' Walker-Loud
> > What type of databases? sql server, mysql, sqllite? Hi James, well this already helps. I don't even know. Do I have to know ahead of time? Or is there a general database package that can open a databases without knowing there format? Thanks, Andre

Re: [Tutor] need advice about a dictionary ({})

2011-09-10 Thread Richard D. Moores
Thanks so much, Jack. You've given me much to chew on. I began phone_book.py without much need for it -- I already had an RTF file with 786 lines that I "grepped" using a script I wrote with Tutor help long ago. I used an RTF file instead of a text file so that any URLs in it would be live. But I

Re: [Tutor] need advice about a dictionary ({})

2011-09-10 Thread Richard D. Moores
Thanks so much, Jack. You've given me much to chew on. I began phone_book.py without much need for it -- I already had an RTF file with 786 lines that I "grepped" using a script I wrote with Tutor help long ago. I used an RTF file instead of a text file so that any URLs in it would be live. But I

Re: [Tutor] need advice about a dictionary ({})

2011-09-10 Thread Richard D. Moores
Jack Trades (actually Nick Zarczynski) just sent me this link to a "Simple phone book app", and has agreed to let me post it to this thread: Dick ___ Tutor maillist - Tutor@python.org To unsubscribe or cha

Re: [Tutor] databases

2011-09-10 Thread Rafael Durán Castañeda
On 10/09/11 21:44, Andre' Walker-Loud wrote: What type of databases? sql server, mysql, sqllite? Hi James, well this already helps. I don't even know. Do I have to know ahead of time? Or is there a general database package that can open a databases without knowing there format? Thanks,

Re: [Tutor] need advice about a dictionary ({})

2011-09-10 Thread Jack Trades
On Sat, Sep 10, 2011 at 4:36 PM, Richard D. Moores wrote: > Your idea doesn't seem efficient for me -- > lots of typing and editing. > Not sure what you mean by that? I've updated the gist with a quick 5min implementation of a GUI using Tkinter and the approach I outlined. I think using a GUI i

Re: [Tutor] databases

2011-09-10 Thread Alan Gauld
On 10/09/11 20:44, Andre' Walker-Loud wrote: What type of databases? sql server, mysql, sqllite? well this already helps. I don't even know. Do I have to know ahead of time? Or is there a general database > package that can open a databases without knowing there format? The Python DB API is

[Tutor] databases

2011-09-10 Thread Alejandro Companioni
On Sep 10, 2011, at 6:15 PM, tutor-requ...@python.org wrote: > You might look at http://www.sqlalchemy.org/, since it works with most > databases. However if you are new on databases, I think you should start > learning databases basics, choose a database management system (DBMS) > that fit yo

Re: [Tutor] need advice about a dictionary ({})

2011-09-10 Thread Alan Gauld
On 10/09/11 19:08, Richard D. Moores wrote: Some have suggested using the shelve module. I looked at it but couldn't see in detail how to use it. Did you read the help page? It says: import shelve d = shelve.open(filename) # open, with (g)dbm filename -- no suffix d[key] = data # store dat

Re: [Tutor] need advice about a dictionary ({})

2011-09-10 Thread Richard D. Moores
On Sat, Sep 10, 2011 at 15:32, Alan Gauld wrote: > On 10/09/11 19:08, Richard D. Moores wrote: > >> Some have suggested using the shelve module. I looked at it but >> couldn't see in detail how to use it. > > Did you read the help page? I did. I can see it would be a useful reference once I learn

Re: [Tutor] databases

2011-09-10 Thread Andre' Walker-Loud
> > package that can open a databases without knowing there format? > > The Python DB API is pretty good at covering all the common databases but > sadly everyone has some slight variances so you do need to know which product > you will be using. > > As an example the SQLite package that comes

Re: [Tutor] databases

2011-09-10 Thread Andre' Walker-Loud
>> You might look at http://www.sqlalchemy.org/, since it works with most >> databases. However if you are new on databases, I think you should start >> learning databases basics, choose a database management system (DBMS) >> that fit your needs and learn as much as you can about that specific

Re: [Tutor] need advice about a dictionary ({})

2011-09-10 Thread Alan Gauld
On 11/09/11 00:18, Richard D. Moores wrote: So you open the file and from that point on treat it exactly like a dictionary. I'm still a bit shaky about dictionaries. But you started the post with using a dictionary. Shelve is just a dictionary that lives in a file instead of memory. If you

Re: [Tutor] need advice about a dictionary ({})

2011-09-10 Thread Marc Tompkins
On Sat, Sep 10, 2011 at 4:18 PM, Richard D. Moores wrote: > On Sat, Sep 10, 2011 at 15:32, Alan Gauld > wrote: > > So you open the file and from that point on treat it exactly like a > > dictionary. > > I'm still a bit shaky about dictionaries. > > That right there is the salient bit. Using shel

Re: [Tutor] need advice about a dictionary ({})

2011-09-10 Thread Alan Gauld
On 11/09/11 00:18, Richard D. Moores wrote: Now which part don't you understand? Much of what comes after that is beyond me. I meant to add, you can pretty much ignore all the stuff at the end of the Help page about class definitions. You only need that if you intend to create your own spe

Re: [Tutor] databases

2011-09-10 Thread Alan Gauld
On 10/09/11 23:28, Alejandro Companioni wrote: Just wanted to chime in, because I wish someone had told me this sooner, but if you're using a Mac, try to steer clear of mysql-python. Setting it up on a Mac is absolutely infuriating. I've never used MySql on a Mac but I'm curious why it should

Re: [Tutor] databases

2011-09-10 Thread ALAN GAULD
> > package that can open a databases without knowing there format? > So, in case I wasn't clear, the databases are already made by someone else, > and the format is beyond my control. I need/want to learn to manipulate > them. > OK, That wasn't clear. And it makes a difference. You need t

Re: [Tutor] need advice about a dictionary ({})

2011-09-10 Thread Richard D. Moores
On Sat, Sep 10, 2011 at 17:34, Marc Tompkins wrote: > On Sat, Sep 10, 2011 at 4:18 PM, Richard D. Moores > wrote: >> >> On Sat, Sep 10, 2011 at 15:32, Alan Gauld >> wrote: >> >> > So you open the file and from that point on treat it exactly like a >> > dictionary. >> >> I'm still a bit shaky abo

Re: [Tutor] need advice about a dictionary ({})

2011-09-10 Thread Richard D. Moores
On Sat, Sep 10, 2011 at 17:34, Alan Gauld wrote: > On 11/09/11 00:18, Richard D. Moores wrote: > >>> So you open the file and from that point on treat it exactly like a >>> dictionary. >> >> I'm still a bit shaky about dictionaries. > > But you started the post with using a dictionary. > > Shelve

Re: [Tutor] need advice about a dictionary ({})

2011-09-10 Thread Richard D. Moores
On Sat, Sep 10, 2011 at 15:15, Jack Trades wrote: > On Sat, Sep 10, 2011 at 4:36 PM, Richard D. Moores > wrote: >> >> Your idea doesn't seem efficient for me -- >> lots of typing and editing. > > Not sure what you mean by that?  I've updated the gist with a quick 5min > implementation of a GUI us

Re: [Tutor] need advice about a dictionary ({})

2011-09-10 Thread Jack Trades
> > Using Python 2.7 for it, it seems to work fine, except that I can't > see how the GUI helps. It opens only when I use the g option to find > an entry already made. Useful for editing an entry, though. > Well the idea would be to build the app as a full-blown GUI. The GUI search and edit funct

Re: [Tutor] databases

2011-09-10 Thread Alejandro Companioni
On Sep 10, 2011, at 9:29 PM, tutor-requ...@python.org wrote: > I've never used MySql on a Mac but I'm curious why it should be so > difficult. > > MacOS is just BSD Unix under the GUI so why would be any different > to any other Unix type system? What were the problems that you encountered? He

Re: [Tutor] Tkinter Entry field text

2011-09-10 Thread brandon w
On 09/10/2011 10:16 AM, Wayne Werner wrote: On Thu, Sep 8, 2011 at 9:31 PM, brandon w > wrote: How do you display text in a Entry field and have it disappear when a person clicks in it? To get text into this box the person must first delete what i