Re: Lambda going out of fashion

2004-12-22 Thread Keith Dart
features than most people will ever use, and they (Guido, et al.) can stop tinkering with it now and concentrate more on the standard libraries. -- -- ~~~~~ Keith Dart <

Re: how to start a new process while the other ist running on

2004-12-22 Thread Keith Dart
be aware that proctools spawns a process with the subprocess stdio connected to _your_ parent process, and does not inherit the stdio of the parent. So, if the subprocess writes a lot of stuff you must read it, or the subprocess will blo

Re: win32 process name

2004-12-22 Thread Keith Dart
start_time: 42 state: S tms_cstime: 731277 tms_cutime: 9593767 tms_stime: 237 tms_utime: 75 tty_nr: 0 tty_pgrp: -1 vsize: 1429504 wchan: 3222957162 -- -- ~~~~~ Keith

Re: Ack! Zombie processes won't die!

2004-12-22 Thread Keith Dart
here is a module called "proctools". It has a process manager that does this for you. -- -- ~ Keith Dart <[EMAIL PROTECTED]> public key: ID: F3D288E4 = -- http://mail.python.org/mailman/listinfo/python-list

Re: Easy "here documents" ??

2004-12-19 Thread Keith Dart
someone one\nsomething three\nsomewhere four" This allows you to use mapping-substitution syntax on a special string object. But the substituted variables are attributes of the object. String-ifying it gets the new string with the

Re: Python To Send Emails Via Outlook Express

2004-12-19 Thread Keith Dart
and snmplib modules. -- -- ~ Keith Dart <[EMAIL PROTECTED]> public key: ID: F3D288E4 = -- http://mail.python.org/mailman/listinfo/python-list

Re: A completely silly question

2004-12-19 Thread Keith Dart
Jp Calderone wrote: On Sun, 19 Dec 2004 23:15:40 GMT, Keith Dart <[EMAIL PROTECTED]> wrote: Mike Meyer wrote: The termios gives module gives you the tools to manipulate the tty directly, without invoking stty. The tty module gives you an easier interface to those routines. However, it'

Re: A completely silly question

2004-12-19 Thread Keith Dart
tpass" module, as it has the same functions found there. The PagedIO object is used by the CLI framework in pyNMS. -- -- ~ Keith Dart <[EMAIL PROTECTED]> public key: ID: F3D288E4 = -- http://mail.python.org/mailman/listinfo/python-list

Re: input record seperator (equivalent of "$|" of perl)

2004-12-19 Thread Keith Dart
ethod to do what you want. -- -- ~~~~~ Keith Dart <[EMAIL PROTECTED]> public key: ID: F3D288E4 = -- http://mail.python.org/mailman/listinfo/python-list

Re: newbie question

2004-12-19 Thread Keith Dart
self.append(val) else: self.append(Enum(i, str(val))) def __repr__(self): return "%s(%s)" % (self.__class__.__name__, list.__repr__(self)) -- ~~~~~~~

Re: Easy "here documents" ??

2004-12-19 Thread Keith Dart
h a regular parameterized function? -- -- ~~~~~ Keith Dart <[EMAIL PROTECTED]> public key: ID: F3D288E4 = -- http://mail.python.org/mailman/listinfo/python-list

Re: Language fluency (was Re: BASIC vs Python)

2004-12-19 Thread Keith Dart
production", that fluency will decrease? Or that the nifty recent features of Python (generators, etc.) are not useful in "production" code? -- ~~~~~ Keith Dart <[EM

Re: Plugin system; imp module head scratch

2004-12-18 Thread Keith Dart
egular Python module? -- ~~~~~ Keith Dart <[EMAIL PROTECTED]> public key: ID: F3D288E4 = -- http://mail.python.org/mailman/listinfo/python-list

pywhich script - where is that module?

2004-12-17 Thread Keith Dart
Have you ever wondered where your python modules get imported from? Here is a little script, called "pywhich", that will tell you. -- \/ \/ (O O) -- oOOo~(_)~oOOo-------- Keith Da

Re: ".>>>" is a good idea! (OT, was: Re: do you master list comprehensions?)

2004-12-16 Thread Keith Dart
~(_)~oOOo Keith Dart <[EMAIL PROTECTED]> vcard: <http://www.kdart.com/~kdart/kdart.vcf> public key: ID: F3D288E4 URL: <http://www.kdart.com/~kdart/public.key> ==

Re: ".>>>" is a good idea! (OT, was: Re: do you master list comprehensions?)

2004-12-16 Thread Keith Dart
, among other things, sets the prompt to "Python> " 433 $ py Python> print "This has no leader that screws up email programs." This has no leader that screws up email programs. Python> -- \/ \/ (O O) -- oOOo~(_)~oOOo Keith Dart <[EMAIL PROTECTED]> public key: ID: F3D288E4 -- http://mail.python.org/mailman/listinfo/python-list

Re: spawn* or exec* and fork, what should I use and how ?

2004-12-16 Thread Keith Dart
ever, there are libraries in Python that do that for you. See above. -- \/ \/ (O O) -- ----oOOo~(_)~oOOo Keith Dart <[EMAIL PROTECTED]> public key: ID: F3D288E4 -- http://mail.python.org/mailman/listinfo/python-list

Re: subprocess vs. proctools

2004-12-15 Thread Keith Dart
ake my libraries facilitate that, and also be easy to use for beginning Python programmers. Python on Linux is a powerful combination, and I cannot fathom why someone would choose anything less. (I would concede that Python on Darwin is also good) --

Re: Regular Expression

2004-12-14 Thread Keith Dart
\/ \/ (O O) -- oOOo~(_)~oOOo---- Keith Dart <[EMAIL PROTECTED]> vcard: <http://www.kdart.com/~kdart/kdart.vcf> public key: ID: F3D288E4 URL: <http://www.kdart.com/~kdart/public.key> ==

Re: subprocess vs. proctools

2004-12-14 Thread Keith Dart
Donn Cave wrote: Keith Dart <[EMAIL PROTECTED]> wrote: |>> if exitstatus: |>> print "good result (errorlevel of zero)" |>> else: |>> print exitstatus # prints message with exit value This is indeed how the shell works, though the actual failur

Re: Python mascot proposal

2004-12-14 Thread Keith Dart
s the wisdom of the languages design. 8-) Now, how about an icon that conveys something like that? hm... smoke curled around wizard perhaps? -- \/ \/ (O O) -- oOOo~(_)~oOOo---- Keith Da

Re: Python vs. Perl

2004-12-14 Thread Keith Dart
it out. -- \/ \/ (O O) -- oOOo~(_)~oOOo Keith Dart <[EMAIL PROTECTED]> public key: ID: F3D288E4 -- http://mail.python.org/mailman/listinfo/python-list

Re: gather information from various files efficiently

2004-12-13 Thread Keith Dart
... ;-) -- \/ \/ (O O) -- oOOo~(_)~oOOo Keith Dart <[EMAIL PROTECTED]> public key: ID: F3D288E4 -- http://mail.python.org/mailman/listinfo/python-list

Re: subprocess vs. proctools

2004-12-13 Thread Keith Dart
Nick Craig-Wood wrote: Keith Dart <[EMAIL PROTECTED]> wrote: Oh, I forgot to mention that it also has a more user- and programmer-friendly ExitStatus object that processess can return. This is directly testable in Python: proc = proctools.spawn("somecommand") exitstatus

Re: gather information from various files efficiently

2004-12-13 Thread Keith Dart
Kent Johnson wrote: Keith Dart wrote: try: dict[a].append(b) except KeyError: dict[a] = [b] or my favorite Python shortcut: dict.setdefault(a, []).append(b) Kent Hey, when did THAT get in there? ;-) That's nice. However, the try..except block is a useful pattern for many sim

Re: gather information from various files efficiently

2004-12-13 Thread Keith Dart
xist you add it. -- \/ \/ (O O) -- oOOo~(_)~oOOo---- Keith Dart <[EMAIL PROTECTED]> public key: ID: F3D288E4 ===

Re: [dictionary] how to get key by item

2004-12-13 Thread Keith Dart
ll the items in the original dictionary must be hashable. The example shows just integers, so I assume they are in this case. But generally, this may not work. -- \/ \/ (O O) -- oOOo~(_)~oOOo--

Re: Python vs. Perl

2004-12-13 Thread Keith Dart
Keith Dart wrote: Ian Bicking wrote: Jon Perez wrote: Michael McGarry wrote: I intend to use a scripting language for GUI development and front end code for my simulations in C. I want a language that can support SQL, Sockets, File I/O, and shell interaction. In my experience, Python is

Re: subprocess.Popen

2004-12-12 Thread Keith Dart
Keith Dart wrote: Michele Simionato wrote: I was looking at Python 2.4 subprocess.Popen. Quite nice and handy, but I wonder why a "kill" method is missing. I am just adding it via subclassing, class Popen(subprocess.Popen): def kill(self, signal = SIGTERM): os.kill(self.p

Re: Persistent objects

2004-12-12 Thread Keith Dart
ob instance be there. Check out the Durus project. http://www.mems-exchange.org/software/durus/ -- \/ \/ (O O) -- oOOo~(_)~oOOo---- Keith Dart <[EMAIL PROTECTED]> vcard: <http://w

Re: Persistent objects

2004-12-12 Thread Keith Dart
ob instance be there. Check out the Durus project. http://www.mems-exchange.org/software/durus/ -- \/ \/ (O O) -- oOOo~(_)~oOOo---- Keith Dart <[EMAIL PROTECTED]> vcard: <http://w

Re: Persistent objects

2004-12-12 Thread Keith Dart
ob instance be there. Check out the Durus project. http://www.mems-exchange.org/software/durus/ -- \/ \/ (O O) -- oOOo~(_)~oOOo---- Keith Dart <[EMAIL PROTECTED]> vcard: <http://w

Re: subprocess.Popen

2004-12-12 Thread Keith Dart
NMS. http://sourceforge.net/projects/pynms/ -- \/ \/ (O O) -- oOOo~(_)~oOOo-------- Keith Dart <[EMAIL PROTECTED]> vcard: <http://www.kdart.com/~kdart/kdart.vcf> public key: ID: F3D

Re: swig & Python question

2004-12-11 Thread Keith Dart
o it "manually" using the Python C API. Good luck. -- It's not me. -- \/ \/ (O O) -- ----oOOo~(_)~oOOo Keith Dart <[EMAIL PROTECTED]> public key: ID: F3D288

Re: High level SNMP

2004-12-11 Thread Keith Dart
e and take a message) -- \/ \/ (O O) -- oOOo~(_)~oOOo---- Keith Dart <[EMAIL PROTECTED]> vcard: <http://www.kdart.com/~kdart/kdart.vcf> public key: ID: F3D288E4 URL: <htt