I thought the name of the arg given on the command line should match the name of the arg to the function.
Eg.:
xsibatch -script ts_addpogeogroups.py -lang Python -main addPOGeoGroups -args -arg1 salut
Unless it is diffent with Python of course, this is how it works with VBscript and JScript.
- ½
-----Original Message-----
From: owner-xsi(at)Softimage.COM [mailto:owner-xsi(at)Softimage.COM] On Behalf Of Francois Lord
Sent: 25-May-2007 09:45
To: XSI(at)Softimage.COM
Subject: Re: Passing arguments to Python script in batch
you're in 6.01, right?
Bernard Lebel wrote:
> Still no luck, Marc-André.
>
>
> COMMAND: -script
> C:\Softimage\workgroups\ts_workgroup\data\scripts\ts_pipeline\ts_addpo
> geogroups.py -lang Python -main addPOGeoGroups -args -sAbsModelFile
> salut #ERROR : Traceback (most recent call last):
> #TypeError: addPOGeoGroups() takes exactly 1 argument (0 given) # -
> [line 4294967295] ERROR - Script failed.
> FATAL - Script Aborted.
>
> 1
>
>
> And before someone asks, the function def looks like this:
>
> def addPOGeoGroups( arg1 ):
>
>
>
> Thanks
> Bernard
>
>
>
> On 5/24/07, *Marc-André Belzile* < mbelzile(at)softimage.com
> <mailto:mbelzile(at)softimage.com>> wrote:
>
> The syntax is rather like :
> -script foo.pys -main foo -args -arg1 1 -arg2 2
>
> ------------------------------------------------------------------------
> *From:* owner-xsi(at)Softimage.COM <mailto:owner-xsi(at)Softimage.COM>
> [mailto:owner-xsi(at)Softimage.COM <mailto:owner-xsi(at)Softimage.COM>]
> *On Behalf Of *Bernard Lebel
> *Sent:* May 24, 2007 3:59 PM
> *To:* XSI(at)Softimage.COM <mailto:XSI(at)Softimage.COM>
> *Subject:* Passing arguments to Python script in batch
>
> Can you pass arguments to Python scripts when using -script in
> XSIBATCH? I remember there used to be something about that, is it
> fixed?
>
> COMMAND: -script
> C:\Softimage\workgroups\ts_workgroup\data\scripts\ts_pipeline\ts_addpogeogroups.py
> -lang Python -main addPOGeoGroups -args ['salut']
> //ERROR : Traceback (most recent call last):
> //TypeError: addPOGeoGroups() takes exactly 1 argument (0 given)
> // - [line 4294967295]
> ERROR - Script failed.
> FATAL - Script Aborted.
>
>
> Thanks
> Bernard
>
>
---
Unsubscribe? Mail Majordomo(at)Softimage.COM with the following text in body:
unsubscribe xsi
---
Unsubscribe? Mail Majordomo(at)Softimage.COM with the following text in body:
unsubscribe xsi