[Tutor] Strange Question

2006-04-29 Thread GNULinuxGeek




All,

First, I think this is a wonderful list.  I always see great advice and
great attitudes about helping.

My post is not about evaluating code but instead trying to get a
reasonable judgment as to whether or not python is the best choice for
what I am trying to do.  I have not learned Python yet.  In point of
fact, I have not, as yet learned any programming language much to my
dismay.

I post the process I need below.

So, here goes the work flow I need to support on my job.


  Person goes to a web page.
  The page allows them to retrieve a file from their local hard
drive.
  They make one or two selections with check boxes or drop lists
that define things about image resolution and preferences.
  They enter their E-Mail address to allow the resultant file to be
sent back to them.
  They submit the graphics file (TIFF image) along with the
selections and the file is uploaded.
  The code on the server drops the file in a directory created from
the submitted file name.
  The Python code (cgi script?) calls another application (server
resident) that performs processing on the graphics file.  
  
  The original file, a processed "proof" file and a raw bitmap file
are stored back in the created directory.
  
  The resultant proof file is sent back to them in an E-Mail
message for their approval.
  The person would then go back to another page and "OK" the file
and then the processed image would be sent to yet another E-Mail
address.

Does anyone see a problem with Python doing this?  Also, from my
knowledge position in programming and in Python (zero), should I
attempt this?


Thanks, Best Regards, and keep up the great work,

Ralph





___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor


[Tutor] Another fine mess

2006-05-31 Thread GNULinuxGeek
All,

I posted some time back for another task.

Have a new task now.  You were all so kind with advice that I thought I 
might check my thoughts on this.

Being an old guy and a newbie to Python is the double-whammy, but here goes:

I get a CSV file with ~26 fields and ~7000 records.  This data needs to 
be parsed based on specific field values.

So, here is my "draft" set of steps that I think need to be performed.

   1. Select the "file" of data
   2. Clean the data with "strip" to make sure there is no extraneous
  whitespace
   3. Write the file back to a temp file.
   4. On the new file, select records based on the value of some of the
  fields (like a "sort on" in a spreadsheet.
   5. Parse to obtain the matching records
   6. Do a little math based on how many records and the data in one
  field (success vs. fail)
   7. Output the results of the math so it can be used in a spreadsheet
  to make cute graphics.

We have a PERL guy in the division, but I am trying to use Python only 
to get this done.  My question is

"What is a good way to read and process the lines of the CSV file?" 
Do I pull them in one line at a time and write them to an output file? 
Do I read the whole shebang, clean the data and write an output file, 
then re-open the cleaned file?


Thanking you all prematurely,

Regards,

Ralph
___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor