[cse491] Reg hw8

C. Titus Brown ctb at msu.edu
Sun Nov 1 12:41:09 PST 2009


On Sun, Nov 01, 2009 at 11:17:19AM -0500, duraira1 at msu.edu wrote:
> Hi ,
> Can we "import mimptypes" instead of using a? loop?to set?the MIME type from the given file extension?
> 
> import mimetypes
> fp=open('hi','w')
> fp.close()
> extension=MIMETYPES.GUESS_TYPE('hi')
> extension=extension[0]
> while x is None:
> ??? extention='text/plain'

I didn't know this existed; if it returns the appropriate types, then
sure!

--titus
-- 
C. Titus Brown, ctb at msu.edu



More information about the cse491-fall-2009 mailing list