Re: [Tutor] Python glade

2010-06-18 Thread Lang Hurst
Found the problem. If you want to do this, you have to access the gtkEntry like this self.builder.get_object('student_change').set_completion(completion) instead of self.student_change.set_completion(completion) Lang Hurst wrote: OK, I created a UI in glade which has the followin

[Tutor] Question

2010-06-18 Thread Independent Learner
~After doing a google search, I could not find any good solid anwsers. So I will apologize ahead of time since this is not really a Python specific question. However... ~I was wondering if I should try to learn 2 programming languages at once, Python and C++. Obviously I am working on learning

[Tutor] Python glade

2010-06-18 Thread Lang Hurst
OK, I created a UI in glade which has the following: True True ● 25 basically, a text box. I'm trying to set it up to automatically complete names as I type. My py fil

Re: [Tutor] sqlite3 select extra characters

2010-06-18 Thread Lang Hurst
Steven D'Aprano wrote: On Fri, 18 Jun 2010 03:54:05 pm Lang Hurst wrote: Is there a way to just return the values when using sqlite3? If I: names = c.execute('select names from students') for name in names: print names What is c? A Cursor or a Connection object? It probably d

Re: [Tutor] pydoc?

2010-06-18 Thread Alan Gauld
"Andrew Martin" wrote Hey, everyone, I am new to programming and just downloaded Python 2.6 onto my windows vista laptop. I am attempting to follow 4.11 of the tutorial I am trying to use pydoc to search through the python libraries installed on my computer but keep getting an error invol

Re: [Tutor] pydoc?

2010-06-18 Thread Andrew Martin
On Fri, Jun 18, 2010 at 7:13 PM, Andrew Martin wrote: > Alright I got it. Although i didn't end up doing any typing. All I did was > go to start/module docs and then press open browser. > > Thanks again and next time i will supply more info with the question ___

Re: [Tutor] pydoc?

2010-06-18 Thread Andrew Martin
Alright I got it. Although i didn't end up doing any typing. All I did was go to start/module docs and then press open browser. ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/

Re: [Tutor] pydoc?

2010-06-18 Thread Lowell Tackett
>From the virtual desk of Lowell Tackett --- On Fri, 6/18/10, Andrew Martin wrote: From: Andrew Martin Subject: [Tutor] pydoc? To: tutor@python.org Date: Friday, June 18, 2010, 1:53 PM Hey, everyone, I am new to programming and just downloaded Python 2.6 onto my windows vista laptop. I am

Re: [Tutor] pydoc?

2010-06-18 Thread bob gailer
On 6/18/2010 1:53 PM, Andrew Martin wrote: Hey, everyone, I am new to programming and just downloaded Python 2.6 onto my windows vista laptop. I am attempting to follow 4.11 of the tutorial called "How to Think Like a Computer Scientist: Learning with Python v2nd Edition documentation" (http:/

Re: [Tutor] pydoc?

2010-06-18 Thread bob gailer
On 6/18/2010 1:53 PM, Andrew Martin wrote: Hey, everyone, I am new to programming and just downloaded Python 2.6 onto my windows vista laptop. I am attempting to follow 4.11 of the tutorial called "How to Think Like a Computer Scientist: Learning with Python v2nd Edition documentation" (http:/

[Tutor] pydoc?

2010-06-18 Thread Andrew Martin
Hey, everyone, I am new to programming and just downloaded Python 2.6 onto my windows vista laptop. I am attempting to follow 4.11 of the tutorial called "How to Think Like a Computer Scientist: Learning with Python v2nd Edition documentation" ( http://openbookproject.net/thinkcs/python/english2e/c

Re: [Tutor] Trouble with sockets...

2010-06-18 Thread bob gailer
On 6/17/2010 5:25 AM, Modulok wrote: List, I'm new to sockets and having trouble. I tried to write a simple client/server program (see code below). The client would send a string to the server. The server would echo that back to the client. PROBLEM: I can send data to the server, and get data b

Re: [Tutor] how to shelve classes

2010-06-18 Thread Payal
On Fri, Jun 18, 2010 at 03:16:36PM +0200, Eike Welk wrote: > See: > http://docs.python.org/library/pickle.html#what-can-be-pickled-and-unpickled Thanks for the link and the explanation. With warm regards, -Payal -- ___ Tutor maillist - Tutor@python.o

Re: [Tutor] sqlite3 select extra characters

2010-06-18 Thread Lang Hurst
Thanks. Alan Gauld wrote: "Lang Hurst" wrote Is there a way to just return the values when using sqlite3? I don't think so, select returns a tuple of values, even if there is only one value. I get the list I want, but they look like (u'Cleese, John') is there a way to just return C

Re: [Tutor] Importing files not located on the home directory or standardard library

2010-06-18 Thread Steven D'Aprano
On Thu, 17 Jun 2010 05:10:32 pm Independent Learner wrote: > Lets say I want to load a file called quiz located in C:\Users\Julius > Hernandez\Desktop\Python2.6.5\Online Course\Chp.4 > > How would I configure PYTHONPATH or .pth  or what ever to import this > file from IDLE I don't use Windows, so

Re: [Tutor] how to shelve classes

2010-06-18 Thread Eike Welk
On Friday June 18 2010 12:22:26 Payal wrote: > Hi, > I want to carry my classes around, so I wrote foo.py as, > > #!/usr/bin/python > > import pickle, shelve > > f = shelve.open('movies') > > class F(object) : > def __init__(self, amt) : self.amt = amt > def dis(self) : print 'Amount :

Re: [Tutor] string encoding

2010-06-18 Thread Dave Angel
Rick Pasotto wrote: I can print the string fine. It's f.write(string_with_unicode) that fails with: UnicodeEncodeError: 'ascii' codec can't encode characters in position 31-32: ordinal not in range(128) Shouldn't I be able to f.write() *any* 8bit byte(s)? repr() gives: u"Realtors\\xc2\\xae"

Re: [Tutor] string encoding

2010-06-18 Thread Lie Ryan
On 06/18/10 14:21, Rick Pasotto wrote: >> Remember, even if your terminal display is restricted to ASCII, you can >> still use Beautiful Soup to parse, process, and write documents in UTF-8 >> and other encodings. You just can't print certain strings with print. > > I can print the string fine. It

[Tutor] how to shelve classes

2010-06-18 Thread Payal
Hi, I want to carry my classes around, so I wrote foo.py as, #!/usr/bin/python import pickle, shelve f = shelve.open('movies') 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.

Re: [Tutor] pickling/shelve classes

2010-06-18 Thread Payal
On Thu, Jun 17, 2010 at 11:11:11AM +0200, Eike Welk wrote: > I think it is a bug in IPython: I can do this in regular Python, but in > IPython I get the same error that you get: > Thanks a lot. It works in normal python. Thanks again. With warm regards, -Payal --

Re: [Tutor] sqlite3 select extra characters

2010-06-18 Thread Steven D'Aprano
On Fri, 18 Jun 2010 03:54:05 pm Lang Hurst wrote: > Is there a way to just return the values when using sqlite3? > > If I: > > names = c.execute('select names from students') > for name in names: print names What is c? A Cursor or a Connection object? It probably doesn't make any real dif

Re: [Tutor] sqlite3 select extra characters

2010-06-18 Thread Alan Gauld
"Lang Hurst" wrote Is there a way to just return the values when using sqlite3? I don't think so, select returns a tuple of values, even if there is only one value. I get the list I want, but they look like (u'Cleese, John') is there a way to just return Cleese, John It seems a sham