[Tutor] sys.argv

János Juhász janos.juhasz at VELUX.com
Mon Feb 13 17:41:23 CET 2006


Thanks Andre,

The problem came from my wrong script calling.

Python is just fine :)

I corrected it, and I can call it now with

"""
Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\*\Shell\Flat2Xls\Command]
@="python \"D:\\devel\\xlsxml.py\" \"%1\""
"""

In this case there is a new menu item for the right click popup for any
file that can call my script with the filename as argument.
It works well on my machine with sort and long filenames.
But it uses the old format dos filename on some other PCs.

Is it any way to translate the sort DOS filename to the long NTSF one with
python ?
But it would be fine to set up XP to call my script with the long filename.


Yours sincerely,
______________________________
János Juhász
VELUX Magyarország Fertődi Építőkomponens Kft.
IT Department
Malom Köz 1, H-9431 Fertőd


Telephone direct:      +36 99 537 939
Telephone office:      +36 99 537 920
Office fax:                +36 99 537 921
Telephone mobile:    +36 30 682 6331
@                             janos.juhasz at VELUX.com
www                        www.VELUX.com


Andre Roberge <andre.roberge at gmail.com> wrote on 2006.02.13 16:02:39:

> On 2/13/06, János Juhász <janos.juhasz at velux.com> wrote:
> > Hi,
> >
> > I want to pass args to my python script on XP.
> > This code
> > print 'argv[0] %s' % sys.argv[0]
> > print 'argv[1] %s' % sys.argv[1]
> > print 'argv[2] %s' % sys.argv[2]
> >
> > shows this:
> > argv[0] D:\devel\home\devel\python\db\xlsxml.py
> > argv[1] "K:\IT\admin\test\Flat
> > argv[2] Files\2006\06.02.2006-293753-gy"

> Your path has a space in it (between Flat and Files). This is
> probably why it is
> broken as two different arguments.
> André

>
> >
> > but I would see this:
> > argv[0] D:\devel\home\devel\python\db\xlsxml.py
> > argv[1] "K:\IT\admin\test\Flat Files\2006\06.02.2006-293753-gy"
> > argv[2] ''
> >
> >
> > Yours sincerely,
> > ______________________________
> > János Juhász
> >
> > _______________________________________________
> > Tutor maillist  -  Tutor at python.org
> > http://mail.python.org/mailman/listinfo/tutor
> >



More information about the Tutor mailing list