<!--/*SC*/DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"/*EC*/-->
<html><head><title></title><style type="text/css"><!--body{padding:1ex;margin:0px;font-family:sans-serif;font-size:small;}a[href]{color:-moz-hyperlinktext !important;text-decoration:-moz-anchor-decoration;}blockquote{margin:0;border-left:2px solid #144fae;padding-left:1em;}blockquote blockquote{border-color:#006312;}blockquote blockquote blockquote{border-color:#540000;}--></style></head><body><div style="font-family: Arial; font-size: medium;" dir="ltr"><div>Does Python provide a way to format a string according to a 'picture' format?</div>
<div> </div>
<div>For example, if I have a string '123456789' and want it formatted like '(123)-45-(678)[9]', is there a module or function that will allow me to do this or do I need to code this type of transformation myself?</div>
<div> </div>
<div>Thank you,</div>
<div>Malcolm</div>
<br></div></body></html>