[Tutor] REG : Pexpect timeout issue

2018-09-01 Thread krishna chaitanya via Tutor
7;)#chasis = child.before.decode('utf-8')child.expect('krishna@krishna-desktop:~/python_excercises$',timeout = 50)child.sendline('ls -l')chasis = child.before.decode('utf-8')print(chasis) Error :     raise TIME

[Tutor] python beginner-doubt

2013-05-15 Thread subha krishna
hi, i need an help in the following program i just started to learn. if speed >= 80: print 'License and registration please' if mood == 'terrible' or speed >= 100: print 'You have the right to remain silent.' elif mood == 'bad' or speed >= 90: print "I'm going to have to write you a ticket." w

[Tutor] first python program to find citeulike duplicates

2008-11-20 Thread Suresh Krishna
hi everybody, i wrote this to solve the problem of exact duplicate entries in my citeulike library, that i wanted to remove. so i exported my entries in ris format, and then parsed the entries to find exact duplicates based on matching fields. the exact duplicates came about because i uplo

[Tutor] Obtaining various combinations of a given word

2008-07-29 Thread sai krishna
Hi,everyone. My name is Sai krishna, and I'm new to Python as well as Programming. I wanted to print out all the combinations of a given word. I am doing it this way: n='cat' def arrange(n): if len(n)==1: #length of word is 1 print n elif len(n)==2: # length of word is 2

[Tutor] and-or precedence

2005-10-10 Thread Krishna
>>> 1 or 2 and 3 1 Why does the above expression return 1? As per my understanding of boolean operations, this is what should have happaned: 1 or 2 => 1 and then 1 and 3 => 3 The library reference also suggests that 'or' has higher priority than 'and'. http://docs.python.org/lib/boolean.html Th

Re: [Tutor] Exception handling - syntaxerror?!

2005-09-25 Thread Krishna
On 25/09/05, Andrei <[EMAIL PROTECTED]> wrote: > > Think the mail system screwed up the formatting! But am fairly sure > > that I have indented it correctly in the console. Try and Except are > > in the column. Any other hints? > > Yes :). Compare: > > >>> try: > ... os.system('cls') > ... excep

Re: [Tutor] Exception handling - syntaxerror?!

2005-09-25 Thread Krishna
On 25/09/05, ZIYAD A. M. AL-BATLY <[EMAIL PROTECTED]> wrote: > On Sun, 2005-09-25 at 18:55 +0530, Krishna wrote: > > When I try to run the following piece of code, I get a SyntaxError, > > can someone help me out on this? > > > > try: > > ... os.system(&quo

[Tutor] Exception handling - syntaxerror?!

2005-09-25 Thread Krishna
When I try to run the following piece of code, I get a SyntaxError, can someone help me out on this? try: ... os.system("cls") ... except: ... print "Foo" ... print "Bar" Traceback ( File "", line 5 print "Bar" ^ SyntaxError: invalid syntax What am I missing? Thanks in advan