Ole Jensen wrote: > Hi > > I made a small python program at home and tried to send by email > attachments to my studymates. > The attachment however shows up as a strange text > > the first lines look like this: > > M1F]R<_AG(#(@+2 R(&=E;F5R871O<F5R("[EMAIL PROTECTED]<R#0H@"5!I"[EMAIL > PROTECTED])4"!O > M;&EE<'5M<&4)4"!V86YD<'5M<&4)4"!F<FEK=&EO;@EB97)E9VYE="[EMAIL PROTECTED] > M5&EM92 P( [EMAIL PROTECTED]( DS-C(S-C N," ),3(R,BXR,C(R,C(R > M,B ),30V-"[EMAIL PROTECTED] ... > <http://groups.google.com/groups/unlock?msg=c42d7058ff6b0c28&hl=en&_done=/group/gruppe-b1/browse_thread/thread/23a5c2bfae647d8b%3Fhl%3Den>@X.2 > > ),3$R+C(S,S,S,S,S,R ),S0Y,3,T+C$W,[EMAIL PROTECTED] > M,PT*5&EM92 Q( [EMAIL PROTECTED]( DS-34S-# N," ),3(R,BXR,C(R > > I was thinking that it might be the binary representation of my .py > files? (the files were not compresses, just basic .py-files) > If so is there anyways its possible to convert it back into an > ordinary text file? through either Python og Windows?
Your email application attached the files using a standard called MIME (Multipurpose Internet Mail Extensions, see: http://www.faqs.org/rfcs/rfc2045.html Part of the standards involves the choice of using a base64 encoding to ensure the attachment is 7-bit clean to properly transfer over SMTP, that's what you're seeing is the encoded attachment. Several things may have happened. 1) the program you used to send the mail didn't perform the MIME attaching correctly and didn't include the proper information for the receiver to decode, 2) something corrupted the email in transit or 3) the email client reading the email doesn't know how to handle MIME. If the problem is not 2 then you could open the email with a different mail application or you could save the raw email to a file and try to use python or other tools to extract the content. Check out http://docs.python.org/lib/module-email.html for details on extracting MIME from email messages or simply look at http://docs.python.org/lib/module-base64.html for info on decoding the attachment after you've manually extracted the encoded text from the file. Hope that's at least a little bit of help, e. > > I ain'tt gonna be back to my own PC for the rest of the weekend so > some of the study work requires me to decode the attachments. > > All help highly appriciated > Best regards > > Ole Jensen > ------------------------------------------------------------------------ > > _______________________________________________ > Tutor maillist - Tutor@python.org > http://mail.python.org/mailman/listinfo/tutor > _______________________________________________ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor