theres no special portion of code, just the one that handles filenames with spaces.<br>the problem is that when i associate a file extension to my application and i open it, the filename is not quoted before passed as an arguement. i dont know if its the problem of windows or something, or it was just my fault when i incorrectly associated the extension. 
<br>anyway, this is the code that outputs the second quote i posted in the original message:<br><br><blockquote style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;" class="gmail_quote">
args = None<br>if len(sys.argv) > 1:<br>    args = sys.argv[1:] <br></blockquote><blockquote style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;" class="gmail_quote">print args
<br></blockquote><br>and this is the code that handles the filenames with spaces (as space generally delimits cmdline params). its not very ellegant, needs a bit of tuning, but it works (i dont use any kind of -d --something params yet).
<br><br>[code]<br>newargs = []<br>
if args:<br>
    first = None<br>
    for arg in args:<br>
        if not first:<br>
            first = arg<br>
            continue<br>
        <br>
        if os.path.isfile(first):<br>
            newargs.append(first)<br>
            first = None<br>
            continue<br>
        <br>
        if arg.find(":") == -1:<br>
            first = " ".join([first, arg])<br>
    <br>
    if first:<br>
        newargs.append(first)<br>[/code]<br><br>how can i make the params get quoted before send as arguments?<br><br>thanks in advance.<br><br><br><blockquote style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;" class="gmail_quote">
<br><br>2007/8/18, O.R.Senthil Kumaran <<a href="mailto:orsenthil@users.sourceforge.net">orsenthil@users.sourceforge.net</a>>:</blockquote><div><span class="gmail_quote"></span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
> Quote:D:\ftp\Music\Mixes & Compilations\Above & Beyond - Essential<br>> Mix\001_Essential_Mix_2004-06-06_-_Above_and_Beyond.txt<br><br>> when i put 'print sys.argv[1:]' at the very beginning of the script, all i
<br>> get is this:<br>><br>> Quote:['D:\\ftp\\Music\\Mixes']<br>><br>Can you share the portion of the code?<br>Are you quoting the argument that you are passing?<br>for e.g:<br><br>#cat 1.py<br>import sys
<br>print sys.argv[1]<br><br>#python 1.py "I am able to print the spaces and & characters"<br>I am able to print the spaces and & characters<br><br>--<br>O.R.Senthil Kumaran<br><a href="http://uthcode.sarovar.org">
http://uthcode.sarovar.org</a><br></blockquote></div><br>