Newbie -> NameError: getopt

Mustafa Cayci acayci at yahoo.com
Mon Apr 4 08:14:46 EDT 2011


Hello,
I followed several postings in Google and came up with the beginning of the 
following code:
During the execution, I am getting 
Problem invoking WLST - Traceback (innermost last):
 File "/home/oracle/wlsuserconfigfiles/./Health_Check_Servers.py", line 80, in 
?
 File "/home/oracle/wlsuserconfigfiles/./Health_Check_Servers.py", line 22, in 
main
NameError: getopt
I thought I was importing the "getopt" as shown below.
Thanks for you help in advance,
Mustafa
#Conditionally import wlstModule only when script is executed with jython
if __name__ == '__main__':
 from wlstModule import *#@UnusedWildImport
 import sys
 import os
 from java.lang import System
 import getopt
 serverName = ''
 portNumber = ''
 ucf = ''
 ukf = ''
 adminURL = ''
 protocolName = ''
 portNumber = ''
def main(argv):
 try:
 opts, args = getopt.getopt(sys.argv[1:], "s:p:t:u:k:")
 except getopt.GetoptError, err:
 print str(err)
 usage()
 sys.exit(2)
...


More information about the Python-list mailing list

AltStyle によって変換されたページ (->オリジナル) /