If System.Environment.CommandLine isn't reporting the arguments then it sounds 
like the arguments aren't getting passed to ipy.exe.  I just tried this on both 
XP, Server 2k3, and Vista and it worked on all three.  Steps I followed:

Create .ipy file:

copy con foo.ipy
import sys
print sys.argv
raw_input()
^Z

Start explorer:

start .

Open foo.ipy

Get the prompt to choose a program, find ipy.exe and start it.

That gives me a new console window that outputs the filename being started and 
waits for me to hit enter.  Starting it from the console also works.  My guess 
would be that there's something wrong w/ the file extension association - did 
you create it through some other means?


-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Alex Li
Sent: Friday, November 10, 2006 8:32 AM
To: users@lists.ironpython.com
Subject: [IronPython] Receiving command line arguments

Hi all,

I am on Windows XP.  I wrote a IronPython script that I want to run
from anywhere on my file system.  So I associated the extension (I use
.ipy since I already have .py asscoiated with python.exe) with ipy.exe,
and put my IronPython script into the search PATH.   Now when I open a
command line console anywhere in the file system, I can called my
script directly without typing ipy.exe in front.   However the command
line arguments are not being passed to either sys.argv or
System.Environment.CommandLine.

Now if I call my script with ipy.exe (and with full path to my script),
then those command line arguments would show up.

Am I doing something wrong or is this a bug?

Thanks,
Alex

_______________________________________________
users mailing list
users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
_______________________________________________
users mailing list
users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com

Reply via email to