Re: [Tutor] Use python to parse the subject line of emails, listen for and react to commands

2015-02-27 Thread Willie Sims
Sorry, I should clarify something No one has taught me anything, I have been trying to learn all this on my own. To be honest much of the code I have is taken from examples and modified for what I was trying to do. Talk about learning the Hard Way!!! I have actually made everything work My tes

Re: [Tutor] Use python to parse the subject line of emails, listen for and react to commands

2015-02-27 Thread Danny Yoo
> That's nearly always a bad idea. eval is a big security risk, especially if > applied to external input. And as you've discovered, > it makes debugging into a bit of a nightmare. Yes, I concur with Alan. eval() is definitely the wrong tool here. It's **extraordinarily** dangerous in the context

Re: [Tutor] Use python to parse the subject line of emails, listen for and react to commands

2015-02-27 Thread Alan Gauld
On 27/02/15 19:43, Willie Sims wrote: I have started working with 2.7 simply because I don't know when the error is caused by me or because of version issues. This is how far I have gotten, I can access and pull emails that only come from a selected email address (OWNER) I have it parsed down to

Re: [Tutor] Help with python in MAC OS 10.6

2015-02-27 Thread Cameron Simpson
On 27Feb2015 02:16, Barbara Heliodora G. Rodrigues wrote: I'd like to ask for help with an issue I have with python. My MAC is with OS 10-6.8, darwin kernel, 64 bits. For some reason I updated macports and it automatically updated python to 2.7 with a 32 bits library, and it is giving me lot

Re: [Tutor] Variable data to CSV

2015-02-27 Thread Alan Gauld
On 27/02/15 20:00, Thomas Toker wrote: Hey all so I'm new to python(like 2 days ago new) Welcome. However it will help if: 1) You always post in plain text. As you see below HTML code gets zapped in email. I need to find the device address, usb port, and number of times the error occurs

Re: [Tutor] Use python to parse the subject line of emails, listen for and react to commands

2015-02-27 Thread Willie Sims
I have started working with 2.7 simply because I don't know when the error is caused by me or because of version issues. This is how far I have gotten, I can access and pull emails that only come from a selected email address (OWNER) I have it parsed down to print the subject only And I have it sa

[Tutor] Variable data to CSV

2015-02-27 Thread Thomas Toker
Hey all so I'm new to python(like 2 days ago new) I need to find the device address, usb port, and number of times the error occurs Heres what I have:  import re import csv import reimport csvf = open("file.txt", "r") #location of log file searchlines = f.readlines()                   #create list

Re: [Tutor] Use python to parse the subject line of emails, listen for and react to commands

2015-02-27 Thread Danny Yoo
On Thu, Feb 26, 2015 at 4:18 PM, Alan Gauld wrote: > On 26/02/15 20:51, Willie Sims wrote: >> I know py can parse emails, but I cant figure out how to limit to only >> the subject and only if its in that certain format >> and only if its coming from a recognized email address > > OK, Show us what

[Tutor] CLI args [was:Re: Tutor Digest, Vol 132, Issue 57]

2015-02-27 Thread Alan Gauld
On 27/02/15 12:31, Rishi Ganesh V wrote: in the script it is like def convert(inputfile, outputfile): reader = csv.reader(open(inputfile, "rb")) file = open(outputfile, 'w+') .. inputfile=sys.argv[1] , output file=sys.argv[2] convert(inputfile,outputfile) The assignments need to

Re: [Tutor] Tutor Digest, Vol 132, Issue 57

2015-02-27 Thread Rishi Ganesh V
Dear tutor, how to pass the argument in the command line i have the input file as csv and output file as txt both input file and output file i am passing the value to an argument in the command line in the script it is like def convert(inputfile, outputfile): reader = csv.reader(open(inputfile,

Re: [Tutor] Tutor Digest, Vol 132, Issue 57

2015-02-27 Thread Rishi Ganesh V
how to pass the argument in the command line i have the input file as csv and output file as txt both input file and output file i am passing the value to an argument like inputfile=sys.argv[1] , output file=sys.argv[2] convert(inputfile,outputfile) how to pass the value in argument On Fri, Fe

Re: [Tutor] Remove a blank row of a Table

2015-02-27 Thread Alan Gauld
On 27/02/15 03:19, shouqiang1...@sina.com wrote: Hello, everybody, I came accross a question a few days ago. I wrote a Python script to copy something to a table in a word file. For some reaons, there are some blank rows. And I want to remove the blank rows. I tried many ways, but all didn't

Re: [Tutor] Help with python in MAC OS 10.6

2015-02-27 Thread Alan Gauld
On 27/02/15 02:16, Barbara Heliodora G. Rodrigues wrote: Dear tutor, I'd like to ask for help with an issue I have with python. My MAC is with OS 10-6.8, I'm not a MacOs expert but I know MacOS uses Python in some of its tools so do not mess with the standard version, you might break somethin

[Tutor] Remove a blank row of a Table

2015-02-27 Thread shouqiang1989
Hello, everybody, I came accross a question a few days ago. I wrote a Python script to copy something to a table in a word file. For some reaons, there are some blank rows. And I want to remove the blank rows. I tried many ways, but all didn't work. Below is the code. The code in blue is t