I Started recently working on jython/python, and come across the following problems and here are the solutions for those
2010-02-25 03:14:40 CDSUpdateAPP.py main ERROR ('Update of application failed:', <class exceptions.NameError at 664938402>, <exceptions.NameError instance at 97256908>)
The above exception can be arise while running jythin scripts which has usage of undeclared variables. see example below.
print super
The above is one of the code line in our jython script, in this case super is treated as variable and if it is not declared the above exceptions will results as super varibale is not initiated.
we can do some thing like
print "super" which will treat super as string and prints it on console.
P.S : Line spaces and alignment are very much important in python scripts
- How to compare strings in the jython/python script
norm = "6.0.2.35"In the above code snippet cmp(wsadminVers, norm) will compare two string values in wsadminVers and norm. If wsadminVers less than norm it return -1. If both are equal it returns 0. If wsadminVers is greater than norm it return 1. So cmp method is very easy string comparison method in jython.
if cmp(wsadminVers, norm) == -1:
print "quote_required"
else:
print "quote_not_required"
quote = 0
print quote
- How to resolve this exceptions or errors
2010-02-25 03:14:40 CDSUpdateAPP.py main ERROR ('Update of application failed:', <class exceptions.NameError at 664938402>, <exceptions.NameError instance at 97256908>)
The above exception can be arise while running jythin scripts which has usage of undeclared variables. see example below.
print super
The above is one of the code line in our jython script, in this case super is treated as variable and if it is not declared the above exceptions will results as super varibale is not initiated.
we can do some thing like
print "super" which will treat super as string and prints it on console.
P.S : Line spaces and alignment are very much important in python scripts
2 comments to "String comparision in Jython script class exceptions.NameError exceptions.NameError instance"
Post a Comment
Whoever writes Inappropriate/Vulgar comments to context, generally want to be anonymous …So I hope U r not the one like that?
For lazy logs, u can at least use Name/URL option which doesn’t even require any sign-in, The good thing is that it can accept your lovely nick name also and the URL is not mandatory too.
Thanks for your patience
~Krishna(I love "Transparency")
Popular Posts
-
The best solution to know about these init levels is to understand the " man init " command output on Unix. There are basically 8...
-
How to Unlock BSNL 3G data card to use it with Airtel and Vodafone Model no : LW272 ? How to unlock BSNL 3G data card( Model no : LW272 )us...
-
How to transfer bike registration from one State to other (Karnataka to Andhra)?? Most of us having two wheelers purchased and registered in...
-
ఓం శ్రీ స్వామియే శరణం ఆయ్యప్ప!! Related posts : Trip to Sabarimala - Part 1 Trip to Sabarimala - Part 2 Ayappa Deeksha required things...
-
Following are some of interesting blogs I found till now ...please comment to add your blog here. Blogs in English : http://nitawriter.word...
Popular posts
- Airtel and vodafone GPRS settings for pocket PC phones
- Andhra 2 America
- Ayyappa Deeksha required things
- Blogs I watch !
- Captions for your bike
- DB2 FAQs
- Deepavali Vs The Goddes of sleep
- ETV - Dhee D2 D3
- Evolution of smoking in India Women
- How to make credit card payments?
- init 0, init 1, init 2 ..
- Java-J2EE interview preparation
- mCheck Application jar or jad download
- My SQL FAQs
- My Travelogues
- Old is blod - New is italic
- Online pay methids for credit cards
- Oracle FAQs
- Pilgrimages
- Smoking in Indian Women
- Technology Vs Humans
- Twitter feeds for all Telugu stars on single page.
- Unix best practices
- Unix FAQs
Buffs ...
Tags
Powered by WidgetsForFree
Archives
-
▼
2010
(35)
-
▼
March
(7)
- Automatically start Websphere after system reboot ...
- String comparision in Jython script class exceptio...
- WSVR0009E: Error occurred during startup Cannot ge...
- print the time,date and time zone in java program ...
- How to find Websphere Version in python/jython scr...
- Big Banyan Tree,Srirangapatnam,Balmuri-Edmuri Fall...
- Modelart R/C Helicopter-For indoor flight-3Channel...
-
▼
March
(7)
Anonymous says:
Here i had one question..Genrally when would we prefer Jython/Python Scripting,on what kind of application u have started of using this scipting..
i follow your blog frequently..i wonder how you get the time to put all these..good work..
Krishna says:
@ Anonymous : Hi, Glad to know that people follow my blog frequently. just want to help others as much as possible, this is the only motto which moves me daily. and coming to you question I got a chance to work with jython while Im working with Websphere. Our products installation which is deploying into Websphere.
See this link for Difference between Jython and python - http://www.krishnababug.com/2010/04/difference-between-jython-and-python.html