[Tutor] what's wrong with this ?

2015-04-21 Thread lei yang
start_time = 2014-7-1 revlines = commands.getoutput(git log --pretty=format:'%ad:%an' --date=short --since='%s' --no-merges %start_time).strip().split('\n') Traceback (most recent call last): File stdin, line 1, in module ValueError: unsupported format character 'a' (0x61) at index 26 if I

[Tutor] how to express shift+enter in python

2014-09-28 Thread lei yang
Hi expert, How to express shift+enter in python ? Thanks ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] how to express shift+enter in python

2014-09-28 Thread lei yang
Hi Chris, I just use xlwt lib to newline in one cell, I find it display with one line in windows but works in linux, so I guess it maybeshift+enter to newline Lei On Sun, Sep 28, 2014 at 11:04 PM, Chris “Kwpolska” Warrick kwpol...@gmail.com wrote: On Sun, Sep 28, 2014 at 4:53 PM, lei yang

[Tutor] how to send ctrl+a+c with python

2014-01-22 Thread lei yang
Hi expert, I want to use pexpect to send ctrl+a+c how should I do? self.vm_session.sendline() how to fill ??? ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options:

Re: [Tutor] how to send ctrl+a+c with python

2014-01-22 Thread lei yang
thanks, it works for me Lei On Wed, Jan 22, 2014 at 10:35 PM, eryksun eryk...@gmail.com wrote: On Wed, Jan 22, 2014 at 8:49 AM, lei yang yanglei.f...@gmail.com wrote: I want to use pexpect to send ctrl+a+c What's ctrl+a+c? If this is for screen, then I think you mean ctrl+a c

[Tutor] help about to how many times the function called

2013-01-04 Thread lei yang
Hi experts I have a function will print PASS status def print_pass(t_elapsed): Print PASS to stdout with PASS (green) color. print_stdout(bcolors.PASS + PASS + bcolors.ENDC + (%.2f s) % t_elapsed) I want to calculate the pass number, so I want to get how many times this

Re: [Tutor] why ifconfig is alway running?

2010-12-20 Thread lei yang
On Sun, Dec 19, 2010 at 9:05 PM, Sander Sweers sander.swe...@gmail.com wrote: On 19 December 2010 13:43, lei yang yanglei.f...@gmail.com wrote: Right, it gets stuck at the readline(), is there a function not get stuck to instead of readline(). readline() will keep reading stdout until

Re: [Tutor] why ifconfig is alway running?

2010-12-19 Thread lei yang
On Sun, Dec 19, 2010 at 4:57 PM, Alan Gauld alan.ga...@btinternet.com wrote: lei yang yanglei.f...@gmail.com wrote def runForAWhile(cmd, secs=10):   print(running %s % cmd)   timeout = datetime.timedelta(seconds=secs)   print timeout   proc = subprocess.Popen(cmd, stdout=subprocess.PIPE

Re: [Tutor] why ifconfig is alway running?

2010-12-19 Thread lei yang
handle this issue, and I find my script cant process the timeout to kill it. if cmd=ping 128.114.122.2, no this issue. Lei On Sun, Dec 19, 2010 at 4:57 PM, Alan Gauld alan.ga...@btinternet.com wrote: lei yang yanglei.f...@gmail.com wrote def runForAWhile(cmd, secs=10):   print(running %s

Re: [Tutor] why ifconfig is alway running?

2010-12-19 Thread lei yang
at that line. But if you ctrl-C to stop the script, you should see where your program gets stuck. You didn't say where it got stuck, that would have helped. Good luck,  Evert On Sun, Dec 19, 2010 at 4:57 PM, Alan Gauld alan.ga...@btinternet.com wrote: lei yang yanglei.f...@gmail.com wrote

Re: [Tutor] why ifconfig is alway running?

2010-12-19 Thread lei yang
alan.ga...@btinternet.com wrote: lei yang yanglei.f...@gmail.com wrote def runForAWhile(cmd, secs=10):   print(running %s % cmd)   timeout = datetime.timedelta(seconds=secs)   print timeout   proc = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True

Re: [Tutor] why ifconfig is alway running?

2010-12-19 Thread lei yang
see where your program gets stuck. You didn't say where it got stuck, that would have helped. Good luck,  Evert On Sun, Dec 19, 2010 at 4:57 PM, Alan Gauld alan.ga...@btinternet.com wrote: lei yang yanglei.f...@gmail.com wrote def runForAWhile(cmd, secs=10):   print(running %s % cmd

Re: [Tutor] why ifconfig is alway running?

2010-12-19 Thread lei yang
On Sun, Dec 19, 2010 at 9:05 PM, Sander Sweers sander.swe...@gmail.com wrote: On 19 December 2010 13:43, lei yang yanglei.f...@gmail.com wrote: Right, it gets stuck at the readline(), is there a function not get stuck to instead of readline(). readline() will keep reading stdout until

[Tutor] why ifconfig is alway running?

2010-12-18 Thread lei yang
my script is #!/usr/bin/env python import datetime import subprocess import sys import os import signal from time import sleep def runForAWhile(cmd, secs=10): print(running %s % cmd) timeout = datetime.timedelta(seconds=secs) print timeout proc = subprocess.Popen(cmd,

Re: [Tutor] why ifconfig is alway running?

2010-12-18 Thread lei yang
always !=0“ why program is NOT exited Lei On Sun, Dec 19, 2010 at 1:15 AM, Alan Gauld alan.ga...@btinternet.com wrote: lei yang yanglei.f...@gmail.com wrote def runForAWhile(cmd, secs=10):   proc = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True