Thursday, August 30, 2012

argument after * must be a sequence

While trying to call my new python code through a Gseos.Tsequencer, I kept getting this error: "argument after * must be a sequence". The code runs fine when called directly. It turns out the problem was because my routine had only one argument aside from the sequence ID. When you call a routine through the Tsequencer, you feed in your arguments and it prepends the sequence ID as the first argument. Other routines are called in the Tsequencer like: Gseos.Tsequencer("name", routine(argument1, argument2, argument3, argument4)). I was calling mine this way: Gseos.Tsequencer("name", routine(argument)). According to this site:

https://code.djangoproject.com/ticket/14088

I have to have the arguments to the routine in the format of a "tuple" (or maybe it's a "list"). I think this might be so that the overloading with the sequence ID can work. That would be like: Gseos.Tsequencer("name", routine(argument,)).

Sure enough, it worked!