pexpect - logging input AND output

2014-08-14 Thread sj . constantine
i have a script running a few commands on a network device. i can't seem to figure out how to log both the input and output of what the pexpect script initiates and responds to. child = pexpect.spawn ('telnet '+ ip) child.expect ('.*:*') child.sendline (user) child.expect ('.*:*') child.sendline

Re: Perl Template Toolkit: Now in spicy new Python flavor

2008-01-15 Thread SJ Carter
Congrats. This will no doubt prove valuable to any Python programmer. -- http://mail.python.org/mailman/listinfo/python-list

Trouble displaying image with tkinter

2006-08-06 Thread sj
uot;command"] = self.quit self.qbutton.pack(side = "top") idata = PhotoImage(file="/home/sj/documents/projects/xaed/images/cat_001.gif") canvas = Canvas(width=300,height=200) canvas.pack(side="top",fill=BOTH,expand=YES) canv

using globals

2006-08-03 Thread sj . vanwerkhoven
Hi, I have got a problem with importing global variables. For instance I have got two files: # t1.py #t2.py counter = 1 def counter_adder(filenr): def show_adder(): global counter

Re: Controlling exception handling of logging module

2005-10-19 Thread sj
Thanks, but my point wasn't fixing the bug. I'd like the logging module to raise an exception on this occasion (rather than print and consume the error) so that I can find the bug easily. If those two lines were part of 10,000-line code, I'd have to check all logging statements one-by-one. -- h

Controlling exception handling of logging module

2005-10-19 Thread sj
Suppose the following are part of a long file and executed: logging.basicConfig(stream = sys.stderr, level=logging.INFO) logging.info("%d %d", 1, 2, 3)# buggy Python prints the traceback of the error as follows: Traceback (most recent call last): File ".../local

list implementation

2005-07-17 Thread sj
I believe the type "list" is implemented as an array of pointers. Thus, random access is an O(1) operation while insertion/deletion is an O(n) operation. That said, I have the following questions: 1. Am I correct in saying the above? 2. Implementing list as an array is part of language specifica

list implementation

2005-07-17 Thread sj
I believe the type "list" is implemented as an array of pointers. Thus, random access is an O(1) operation while insertion/deletion is an O(n) operation. That said, I have the following questions: 1. Am I correct in saying the above? 2. Implementing list as an array is part of language specifica