sys.argv problem in Win 2k

Anand B Pillai abpillai at lycos.com
Fri Apr 25 03:10:58 EDT 2003


Hi Duncan

 There was a problem with this but I fixed it in the
registry. Now the associations are fine, but still the
cmd line problem remains!

#test+
F:\users\anand\LocalWorkspaces\ResModWS>ftype Python.File
Python.File=D:\Python22\pythonw.exe "%1"

F:\users\anand\LocalWorkspaces\ResModWS>ftype Python.File
Python.File=D:\Python22\python.exe "%1"

F:\users\anand\LocalWorkspaces\ResModWS>assoc .py
.py=Python.File

F:\users\anand\LocalWorkspaces\ResModWS>assoc .pyw
.pyw=Pythonw.File

F:\users\anand\LocalWorkspaces\ResModWS>ftype Pythonw.File
Pythonw.File=D:\Python22\pythonw.exe "%1"
#test-

#example+
#cmdtest.py
import sys

print sys.argv
for x in sys.argv:
    print x

D:\OpensourceApps>cmdtest.py
['D:\\OpensourceApps\\cmdtest.py']
D:\OpensourceApps\cmdtest.py
#example-

 Huh ?  ---

Thanks

ABP
Duncan Booth <duncan at NOSPAMrcp.co.uk> wrote in message news:<Xns936790B52180Eduncanrcpcouk at 127.0.0.1>...
> abpillai at lycos.com (Anand B Pillai) wrote in 
> news:bd993a2f.0304240506.5b206f3d at posting.google.com:
> 
> >  As you see the arguments I pass are not being printed!
> > This is the case with all my scripts now. They were working
> > well when I was on a WinNT workstation :-?
> 
> What does the command 'assoc .py' print?
> What does the command 'ftype Python.File' print?
> 
> Running a .py file depends on the file association which the assoc command 
> will show, and if it is Python.File the ftype command will show how the 
> command line is passed.
> 
> They should look something like this:
> 
> D:\temp>ftype Python.File
> Python.File=D:\Python22\python.exe "%1" %*
> 
> D:\temp>assoc .py
> .py=Python.File




More information about the Python-list mailing list