Re: [Tutor] don't repeat yourself; question about code optimization

2007-07-22 Thread tpc247
On 7/20/07, Bob Gailer <[EMAIL PROTECTED]> wrote: Take advantage of slicing: def create_grid(self): table = [] for i in range(0, len(self.total_num_of_items), self.max_num_of_items_per_row): table.append(tuple(self.total_num_of_items[i : i + self.max_num_of_items_per_ro

Re: [Tutor] IDLE Usage - was Interpreter Restarts

2007-07-22 Thread Robert H. Haener IV
Alan Gauld wrote: > I've heard of screen but never used it. > The biggest problem I can see with it is that you can only see one > screen(sic) at a time or use split screens to see partial screens. > > Can you copy/paste between sessions? > Does it run on a remote server within the SSH client? I

Re: [Tutor] How to determine if every character in one string is inanother string?

2007-07-22 Thread Jerry Hill
On 7/21/07, Alan Gauld <[EMAIL PROTECTED]> wrote: > > all(char in string.printable for char in testString) > > What is all? > Is that a 2.5 thing (I'm still on 2.4 here) Yes, it's a 2.5 thing. All returns true if all of the elements of an iterable are true. According to the docs, it is the equiv

Re: [Tutor] IDLE Usage - was Interpreter Restarts

2007-07-22 Thread Alan Gauld
"Eric Brunson" <[EMAIL PROTECTED]> wrote >>>http://en.wikipedia.org/wiki/GNU_Screen >>> > You can only see one screen at a time as far as I know. If you need > split screens, use emacs. The wiki page shows a split screen session and claims you can split any session or have multiple sessions

Re: [Tutor] IDLE Usage - was Interpreter Restarts

2007-07-22 Thread Eric Brunson
Alan Gauld wrote: > "Dave Kuhlman" <[EMAIL PROTECTED]> wrote > > >> If you find yourself opening multiple sessions to the same >> UNIX/Linux box, you might want to look into screen, which enables >> you to create and switch between multiple sessions. >> > > >> For more on screen, do "man

Re: [Tutor] IDLE Usage - was Interpreter Restarts

2007-07-22 Thread Alan Gauld
"Dave Kuhlman" <[EMAIL PROTECTED]> wrote > If you find yourself opening multiple sessions to the same > UNIX/Linux box, you might want to look into screen, which enables > you to create and switch between multiple sessions. > For more on screen, do "man screen" and look here: > >http://en.w

Re: [Tutor] IDLE Usage - was Interpreter Restarts

2007-07-22 Thread Dave Kuhlman
On Sun, Jul 22, 2007 at 10:39:51AM +0100, Alan Gauld wrote: > > > OK, Personally I'd forget about a GUI, its not that big a win for > Python IMHO. > > What I'd do instead is open two SSH sessions, in one of them I'd open > a > vim session (or emacs if you prefer) to edit my code. In the secon

Re: [Tutor] IDLE Usage - was Interpreter Restarts

2007-07-22 Thread Sara Johnson
Alan, Actually, I think you just solved one of the main issues I've had. That is, trying to figure out how much it'll help to have the GUI session open with the SSH session (as was recommended when I set out to do these projects). I had it in my mind that having this up and working would mean

Re: [Tutor] IDLE Usage - was Interpreter Restarts

2007-07-22 Thread Alan Gauld
"Sara Johnson" <[EMAIL PROTECTED]> wrote > I use an SSH editor set up by my school. If I type python at the > prompt in SSH, > I get the Python shell. My problem is, I can't open a GUI no matter > what > I subscribe to or purchase. OK, Personally I'd forget about a GUI, its not that big a w