[IronPython] How can I exit from Python Script File?

Dave Fugate dfugate at microsoft.com
Thu May 6 18:03:13 CEST 2010


The snippet below isn't Python...  For Python you'd call:
    import sys
    sys.exit(0)
 
replacing "0" with whatever exit code you want to use.

Dave

-----Original Message-----
From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Thomas Gagne
Sent: Thursday, May 06, 2010 8:59 AM
To: Discussion of IronPython
Subject: Re: [IronPython] How can I exit from Python Script File?

My question is simpler,  how do I exit a regular script?

If ARGV.length != 1
     puts "usage:...."
     Process.exit
end

I get an error calling Process.exit (private member) Process.Exit (method does not exist) sys.Exit (undefined method 'sys' for main:Object)

How do I quit my script?
_______________________________________________
Users mailing list
Users at lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com




More information about the Ironpython-users mailing list