<html>
<head>
<style>
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Verdana
}
</style>
</head>
<body class='hmmessage'>
&nbsp;<BR>
I m using fileDialog(self, message, path, filename, filter, aStyle(opotional)) to save the file. <BR>
In my code, i used fileDialog to show save dialog box and when we click on save button, it should save that file which is of txt type (filter = '*.txt'). But when we click on save button it returns error: "coercing to unicode: need string or buffer, list found" rather than saving / creating a file.&nbsp;I also tried f = file(myfile, 'w', 1000) instead of f = file(myfile, 'w'), where 1000 is buffer size,&nbsp;but both have the same error. where as if we use <BR>

<TABLE cellSpacing=0 cellPadding=0>
<TBODY>
<TR vAlign=baseline>
<TD><NOBR><B><TT class=function id=l2h-27 xml:id="l2h-27">file</TT></B>(</NOBR></TD>
<TD><VAR>filename</VAR><BIG><FONT size=4>[</FONT></BIG><VAR>, mode</VAR><BIG><FONT size=4>[</FONT></BIG><VAR>, bufsize</VAR><FONT size=4><BIG>]</BIG><VAR></VAR><BIG>]</BIG><VAR></VAR></FONT>)</TD></TR></TBODY></TABLE><BR>
, then it creates a file of specified type. But it is not working in fileDialog(). Why?Where i m wrong?<BR>
&nbsp;<BR>
What should i do?<BR>
&nbsp;<BR>
Following is my code:<BR>
def on_btn2_mouseClick(self, event):<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; aStyle = wx.SAVE|wx.HIDE_READONLY|wx.OVERWRITE_PROMPT<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;filter = '*.txt'<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; result = dialog.fileDialog(self, 'ist def', '', 'n', wildcard, aStyle)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; myfile= result.paths<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if result.accepted == True :<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; f = file(myfile, 'w')<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; f.write('my file')<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; f.close()<BR><BR><RTE_TEXT></RTE_TEXT><br /><hr />Connect to the next generation of MSN Messenger   <a href='http://imagine-msn.com/messenger/launch80/default.aspx?locale=en-us&source=wlmailtagline' target='_new'>Get it now! </a></body>
</html>