String manipulation in Python
<p>I am trying to write a command but I do not want one long line that looks untidy. I am looking to add the strings together to be executed as on command. I have some code below which is part of an email function:</p>

<pre><code>msg = MIMEText("The nightly build status was a SUCCESS\n\nBuild File: http://www.python.org\n\n Build Results File: http://10.51.54.57/sandboxes/", project, "\n")
</code></pre>

<p>This shows the one line, I am hoping for a better way to do this. I have tried the below code but it does not work.</p>

<pre><code>msg = MIMEText("The nightly build status was a SUCCESS\n\nBuild File: ")
msg += MIMEText("http://www.python.org\n\n Build Results File: ")
msg += MIMEText("http://10.51.54.57/sandboxes/", project, "\n")
</code></pre>

<p>Thanks for any help.</p>

<p>I have tried the below code but get:</p>

<pre><code>msg = MIMEText("""The nightly build status was a SUCCESS\n\n
   Build File: """,  
   build_file, """
   \n\n 
   Build Results File: """, 
   build_file, """
   \n\n
   Sandbox Folder:""", 
   sandbox, """ 
   \n\n
   Antibrick File: """,
   antibrick, "\n\n")
</code></pre>

<p>Now I get the message:</p>

<pre><code>Traceback (most recent call last):
  File "test_email.py", line 45, in &lt;module&gt;
    if __name__ == '__main__': myObject = email_success()
  File "test_email.py", line 32, in email_success
    antibrick, "\n\n")
TypeError: __init__() takes at most 4 arguments (10 given)
</code></pre>

<p>Any ideas?</p>

<p>Thanks S.Mark, I tried this but when the email is sent it is not as a hyperlink but sent as:</p>

<pre><code>The nightly build status was a SUCCESS


Build File: ('http://10.67.54.57/sandboxes/', '2010-01-05/new_sandbox', 'basebuild') 



Build Results File: ('http://10.67.54.57/sandboxes/', '2010-01-05/new_sandbox', 'basebuild') 



Sandbox Folder: ('http://10.67.54.57/sandboxes/', '2010-01-05/new_sandbox')  



Antibrick File: 
</code></pre>
