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? If so
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 +
Robert H. Haener IV [EMAIL PROTECTED] wrote
This is the second message I've seen asking some questions
about screen which I already answered on the 17th.
I know this is more than a little OT, I'm just wondering if somehow
you didn't get that message.
I was still on vacation on the 17th so
[EMAIL PROTECTED] wrote
one part where I believe I violate the prime directive of coding,
which is
not to repeat yourself:
The prime directive of coding is make it readable!
The DRY principle is just that a principle. If repeating makes for
more maintainable or readable code then repeat
Hi Everybody,
I have a question about restarting a part of the program after it dies.
I have a driver program that instantiates a class and runs methods from that
class. Occasionally, the method gets bad data and it bombs out. Instead of
bombing out, I would like the program to grab new data
Tino Dai [EMAIL PROTECTED] wrote
Your code confused me on several counts but in general...
I have a question about restarting a part of the program after
it dies.
I have a driver program that instantiates a class and runs methods
from that
class. Occasionally, the method gets bad data
I'm looking for a Python module that provides methods for ordering
regexes based on
how general they are ( how much they match). Do I have to write it
myself or does something exist already.
Shidan
___
Tutor maillist - Tutor@python.org
On 7/23/07, Shidan [EMAIL PROTECTED] wrote:
I'm looking for a Python module that provides methods for ordering
regexes based on
how general they are ( how much they match). Do I have to write it
Your question is relative. Classifying which regular expression is
more general depends upon the
Alan Gauld wrote:
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
Alan Gauld wrote:
I was still on vacation on the 17th so wouldn't have seen it then.
But I just checked the gmane archive and there is nothing from
you on the 17th about screen. (Lots about vim and SSH etc but
not about screen)
Alan G.
This is the last I'll add to this little derailment,
[EMAIL PROTECTED] wrote:
On 7/20/07, *Bob Gailer* [EMAIL PROTECTED]
mailto:[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):
Eric Brunson wrote:
Alan Gauld wrote:
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
Sorry about that. I think that a simpler question would be:
In my driver code:
ap = apacheModule.apacheModule(configXML)
while 1:
try:
rVs=ap.perf()
for anObj in self.objList:
getattr(anObj,do)(rVs)
time.sleep(1)
except
A correction to the code at the end. The test of self.total_num_of_items
should precede the pop(0)
[EMAIL PROTECTED] wrote:
On 7/20/07, *Bob Gailer* [EMAIL PROTECTED]
mailto:[EMAIL PROTECTED] wrote:
Take advantage of slicing:
def create_grid(self):
table = []
On Mon, Jul 23, 2007, James Hartley wrote:
On 7/23/07, Shidan [EMAIL PROTECTED] wrote:
I'm looking for a Python module that provides methods for ordering
regexes based on
how general they are ( how much they match). Do I have to write it
Your question is relative. Classifying which regular
Hi
I have a hard time sorting an object list. Perhaps this is kind of a noob
question, but I would very much appreciate any help!
Using django I get a QuerySet of Score objects which are sorted by the
actual score, the actual score divided by the max. possible score (so
sorting by two db
Philippe Niquille wrote:
Hi
I have a hard time sorting an object list. Perhaps this is kind of a
noob question, but I would very much appreciate any help!
Using django I get a QuerySet of Score objects which are sorted by the
actual score, the actual score divided by the max. possible
Tino Dai [EMAIL PROTECTED] wrote
Sorry about that. I think that a simpler question would be:
I'm not sure what the better question is, but I think I
answered it :-)
In my driver code:
ap = apacheModule.apacheModule(configXML)
while 1:
try:
rVs=ap.perf()
for
Philippe Niquille [EMAIL PROTECTED] wrote
The problem I now have, is that I lost the sorting order, as
described
above. How would I resort it with a python algortithm instead of
SQL?
Why not use SQL? Best to get the highest quality data into your
program
that you can, the earlier you
On Sun, 22 Jul 2007, Jerry Hill wrote:
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.
That was my favorite, too. I didn't notice the new all method
Philippe Niquille wrote:
Using django I get a QuerySet of Score objects which are sorted by the
actual score, the actual score divided by the max. possible score (so
sorting by two db fields).
I then need to loop through that queryset and sum up all the score
objects which belong to the
all(char in string.printable for char in testString)
That was my favorite, too. I didn't notice the new all method in 2.5. It
certainly seems the most Pythonic approach.
all() has a sister built-in function, also introduced in 2.5, so i
think that any(char not in string.printable for
On 7/23/07, Alan Gauld [EMAIL PROTECTED] wrote:
Tino Dai [EMAIL PROTECTED] wrote
Sorry about that. I think that a simpler question would be:
I'm not sure what the better question is, but I think I
answered it :-)
In my driver code:
ap = apacheModule.apacheModule(configXML)
while 1:
wesley chun [EMAIL PROTECTED] wrote
the solutions using LCs above are great when it comes to an
expressive
piece of code in a one-liner, but i feel there's a waste of
time/memory. the use of GEs is better, but it still has to iterate
over the entire string when i don't feel that it should
One of my only peeves with LCs is that they always iterate to the end,
I'd like an optional extra 'until' clause, like:
lst = [n for n in veryBigSequence if someTest(n) until anotherTest(n)]
This would act as usual until the final expression was true at which
point it would stop iterating.
If the module has been imported before your code is run, it will be the
library module (very important if working in IDLE which importants many
modules, for example).
So... how does IDLE go about importanting a module? ;)
It's not *how* IDLE imports the module, but that fact that IDLE
Perhaps everyone is trying too hard. Instead of trying to re-initialize the
thread on error, let the thread create a new seperate thread and destroy
itself naturally.
Maybe a shot in the dark? :-/
JS
___
Tutor maillist - Tutor@python.org
On Mon, Jul 16, 2007 at 06:13:35PM -0400, Kent Johnson wrote:
Kent -
Rather than try to reply in detail to your suggestions, I've tried
to ammend my document to reflect your comments.
Thanks again for the help.
Dave
[good suggestions and corrections from Kent, snipped]
--
Dave Kuhlman
Please forgive my instrusion with some simple questions. I don't have any
formal training in programming so I have to get some guidance to some
terminology from time to time. What is a generator and what is its
purpose?
Think of a generator as a list whose contents haven't been finished
Tanks a mill!
I don't know why I searched so far..
Anyway, I wrapped the django custom SQL call and built a nice dictionary out
of the resulting rows (which is similar to querysets). See
http://www.djangosnippets.org/snippets/207/ for details.
Philippe
Am 23.07.2007 um 19:28 schrieb Eric
I am new to Python but not new to programming languages. I have seen this
while 1 a lot. In fact in other languages I would expect while 1 to
be
the same as while TRUE. I have used that in other languages, but in the
definition below I would expect the yield b... to continue on until a
Then I would need to get the file size (but this is giving me an error at
the moment)
for name in files:
s = sum(getsize(join(root, name)
print s (syntax error here. I have not figured it out yet. There
are spaces in the path/filename combo)
(code to parse the file
SQL databases are cool. Make them do as much as they can for you. :-)
Philippe Niquille wrote:
Tanks a mill!
I don't know why I searched so far..
Anyway, I wrapped the django custom SQL call and built a nice
dictionary out of the resulting rows (which is similar to querysets).
See
Alan Gauld wrote:
wesley chun [EMAIL PROTECTED] wrote
the solutions using LCs above are great when it comes to an
expressive
piece of code in a one-liner, but i feel there's a waste of
time/memory. the use of GEs is better, but it still has to iterate
over the entire string when i
Significance of number 4096 :
file is stored in blocks of size 2K/4K/8K (depending
upon the machine). file seek for an offset goes block
by block rather than byte by byte. Hence for file size
4096 (assuming you have 4K block size), you will
anyway end up scanning it entirely so as well load
Tiger12506 wrote:
I am new to Python but not new to programming languages. I have seen this
while 1 a lot. In fact in other languages I would expect while 1 to
be
the same as while TRUE. I have used that in other languages, but in the
definition below I would expect the yield b... to
Tiger12506 wrote:
If the module has been imported before your code is run, it will be the
library module (very important if working in IDLE which importants many
modules, for example).
So... how does IDLE go about importanting a module? ;)
It's not *how* IDLE imports the
Hi,
I have this website (http://solutions-linux.org/) and I have a little news
section on the right side.
Presently the pages are just static html pages, but I would like to do a little
rss file to put the news in it and then do a little script that puts them on
the pages with the right
wesley chun wrote:
from string import printable as prglobal
def printable(s):
prlocal = prglobal
for x in s:
if x not in prlocal:
return False
return True
the solutions using LCs above are great when it comes to an expressive
piece of code in a
Then maybe you could write a regex that matches every regex that does
not match itself.
ha! sorry, couldn't resist.
On Jul 23, 2007, at 11:29 AM, Bill Campbell wrote:
On Mon, Jul 23, 2007, James Hartley wrote:
On 7/23/07, Shidan [EMAIL PROTECTED] wrote:
I'm looking for a Python module
40 matches
Mail list logo