Re: [Tutor] Guidance needed for script

2009-05-10 Thread A.T.Hofkamp
rony dsouza wrote: Hi Al, My name is Rony, I am new to python. Welcome to the list. Need your help and guidance for developing a python script with the below details: Using GnuPG to encrypt a file(s) on linux. Essentially two modes of operation would be ideal: 1. Running something

Re: [Tutor] Parsing Question

2009-05-10 Thread Stefan Behnel
Emile van Sebille wrote: > On 5/9/2009 5:30 PM Alan Gauld said... > >> You should probably be able to do the first for loop as a list >> comprehension, but I can't think of how to get the split() call >> embedded into it right now! >> > > Just for fun -- given datafile contents... > > 1 one 2 t

[Tutor] Guidance needed for script

2009-05-10 Thread rony dsouza
Hi Al,   My name is Rony, I am new to python.   Need your help and guidance for developing a python script with the below details:   Using GnuPG to encrypt a file(s) on linux.  Essentially two modes of operation would be ideal:   1.   Running something like “./encrypt.py inputfilename.txt

Re: [Tutor] How to control the not existent keys in a dict

2009-05-10 Thread Richard Lovely
2009/5/10 Emilio Casbas : > > Hello, > > I have some problems testing keys not existent in a dictionary. > The code works testing existent keys with his corresponding value, but > If I enter a not existent key, an exception is raised. > How can I control the not existent key and assign him a defaul

Re: [Tutor] Suggestions for while loop

2009-05-10 Thread Richard Lovely
2009/5/11 David : > Hi, I am going through Wesley Chun's book and this is Exercise 8-11; > Write a program to ask the user to input a list of names, format "Last Name" > "comma" "First Name". Write a function that manages the input so that > when/if the user types in the names in the wrong format t

Re: [Tutor] Suggestions for while loop

2009-05-10 Thread Dave Angel
David wrote: Hi, I am going through Wesley Chun's book and this is Exercise 8-11; Write a program to ask the user to input a list of names, format "Last Name" "comma" "First Name". Write a function that manages the input so that when/if the user types in the names in the wrong format the err

Re: [Tutor] How to control the not existent keys in a dict

2009-05-10 Thread Alan Gauld
"Emilio Casbas" wrote If I enter a not existent key, an exception is raised. How can I control the not existent key and assign him a default value? One way is to use the get() method of a dictionary: d = {'Exists': True} d['Exists'] True d['Error'] Traceback!!! d.get('Error',Fal

[Tutor] Suggestions for while loop

2009-05-10 Thread David
Hi, I am going through Wesley Chun's book and this is Exercise 8-11; Write a program to ask the user to input a list of names, format "Last Name" "comma" "First Name". Write a function that manages the input so that when/if the user types in the names in the wrong format the error is corrected,

Re: [Tutor] How to control the not existent keys in a dict

2009-05-10 Thread Emile van Sebille
On 5/10/2009 3:48 PM Emilio Casbas said... Hello, I have some problems testing keys not existent in a dictionary. The code works testing existent keys with his corresponding value, but If I enter a not existent key, an exception is raised. How can I control the not existent key and assign him a

[Tutor] How to control the not existent keys in a dict

2009-05-10 Thread Emilio Casbas
Hello, I have some problems testing keys not existent in a dictionary. The code works testing existent keys with his corresponding value, but If I enter a not existent key, an exception is raised. How can I control the not existent key and assign him a default value? u...@cipher:~/project/progra

[Tutor] [OT] EuroPython

2009-05-10 Thread Evans Anyokwu
Is anyone of you guys on this list going to EuroPython? http://www.europython.eu/ Unfortunately, I have registered to attend JavaOne, so can't make it. -- Evans http://www.javawug.org ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailma

Re: [Tutor] Different Command Result Executing in Shell vs. Program

2009-05-10 Thread robert mcquirt
@alan: Thank you very much for the information you provided and also for suggesting your tutorial. I am now studying the subprocess module. I was impressed with the depth of your tutorial and am studying it as well (and not just for my current problem). Thanks again. @dave: Thanks for your repl

Re: [Tutor] Parsing Question

2009-05-10 Thread Emile van Sebille
On 5/9/2009 5:30 PM Alan Gauld said... You should probably be able to do the first for loop as a list comprehension, but I can't think of how to get the split() call embedded into it right now! Just for fun -- given datafile contents... 1 one 2 two 3 three 4 four 5 five 6 six 7 seven 8 eigh

Re: [Tutor] Triggering code on 1 minute intervale ..

2009-05-10 Thread Alan Gauld
"Alex Feddor" wrote .. What will be the best solution to trigger python code every minute as soon as PC in on. This depends on your OS. If its Linux/MacOs then cron might be the best bet. If its Windows you can use scheduled tasks to do it, or the at command. Or youcould write a python sc

Re: [Tutor] Sending Email - Outlook 2003 / Overcome SecurityWarning!

2009-05-10 Thread Alan Gauld
"Alex Feddor" wrote I would like to send email inside my Python code. On PC I have installed Outlook 2003. Outlook is a mail client, you don't need to use it to send email from Python. You can use the email module to do this, or for more detailed access use the smtp module. This just sends

Re: [Tutor] paramiko again

2009-05-10 Thread Alan Gauld
"Matt Herzog" wrote Yes, that is exactly what I wanted, os.listdir. But now I have another issue: specifying the remote dir. When I login to the sftp server and type pwd: sftp> pwd Remote working directory: / Is what I see. OK, so either you have to change dir on the remote machine(via sf