how to increment a value in jython script?

55 views
Skip to first unread message

lazyboy

unread,
Jan 5, 2006, 6:52:52 PM1/5/06
to python
Hi,

I'm trying to convert a simple perl script to a jython script.
However, I'm having a difficulty to get my jython script to work.
Could someone help me out to correct my jython script 's syntax?

Here is my perl script:

for ( $num = 0; $num <= 2; ++$num ) {
system $CLI_PATH . " -cmd addFolder -u admin -p admin
-fullname /folder
" . $num . "/f1/f2/f3/f4/f5 -parents true -desc "testing a cmd" ";
}


Here is my jython script:

import sys
import string
from clui import *
from sys import exit
n = 0
app = PyCLUI()
session = app.execRaw("login", {"u" : "admin" , "p" : "admin"})
while (n <= 2):
app.execRaw("addFolder", {"s" : session , "fullname" :
"/folder-" + str(n) + "/f1/f2/f3/f4/f5", "parents" : true, "desc":
"testing a command"})
app.execRaw("logout", {"s" : session})
exit(0)

Any helps are appreciated.
Thx,
-Chris

Reply all
Reply to author
Forward
Message has been deleted
0 new messages