[Tutor] Emailing code

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

[Tutor] Emailing code

myles broomes
This question isnt so much related to a specific program, just something im curious about. What is the best way to email code? I find that when i copy and paste it into an email, the indentation and spacing gets all messed up.

Myles Broomes

_______________________________________________
Tutor maillist  -  [hidden email]
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor
Reply | Threaded
Open this post in threaded view
|

Re: [Tutor] Emailing code

Emile van Sebille
On 4/6/2012 12:14 PM myles broomes said...
> This question isnt so much related to a specific program, just something
> im curious about. What is the best way to email code? I find that when i
> copy and paste it into an email, the indentation and spacing gets all
> messed up.
>


Set your email client content type to deliver plain text -- anything
html-ish allows compression of spaces hence the formatting loss.

Emile

_______________________________________________
Tutor maillist  -  [hidden email]
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor
Reply | Threaded
Open this post in threaded view
|

Re: [Tutor] Emailing code

wesley chun
In reply to this post by myles broomes
On Fri, Apr 6, 2012 at 12:14 PM, myles broomes
<[hidden email]> wrote:
> This question isnt so much related to a specific program, just something im
> curious about. What is the best way to email code? I find that when i copy
> and paste it into an email, the indentation and spacing gets all messed up.


as an alternative to emailing code, you can paste(bin) it online and
just send (or tweet or G+ or otherwise post) the URL... there are many
providers of this type of service out there:
http://www.similarsitesearch.com/alternatives-to/pastebin.com

cheers,
-- wesley
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
"A computer never does what you want... only what you tell it."
    wesley chun : wescpy at gmail : @wescpy/+wescpy
    Python training & consulting : http://CyberwebConsulting.com
    "Core Python" books : http://CorePython.com
    Python blog: http://wescpy.blogspot.com
_______________________________________________
Tutor maillist  -  [hidden email]
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor
Reply | Threaded
Open this post in threaded view
|

Re: [Tutor] Emailing code

Steven D'Aprano-8
In reply to this post by myles broomes
myles broomes wrote:
> This question isnt so much related to a specific program, just something im
> curious about. What is the best way to email code? I find that when i copy
> and paste it into an email, the indentation and spacing gets all messed up.

Don't send HTML, because that is poison to correct formatting of Python code.
Mail clients feel free to reformat indentation and spacing in arbitrary ways
with HTML emails. Find the setting in your mail client to turn off all
formatting. My guess is that you are using Outlook or Outlook Express -- look
for the setting about "Rich Text", and turn that off.

If you can't turn it off, at least turn on the option to send both HTML (rich
text) and plain text. The HTML version will probably be mangled, but the plain
text version should be okay.

If you are using Thunderbird, turning off format=flowed can sometimes help.

http://kb.mozillazine.org/Plain_text_e-mail_%28Thunderbird%29

For large amounts of code, don't copy and paste into your email. Nearly every
email program in the world allows you to attach attachments. Just attach the
.py file and send that.




--
Steven

_______________________________________________
Tutor maillist  -  [hidden email]
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor